Skip to content

Instantly share code, notes, and snippets.

View sne11ius's full-sized avatar

Cornelius Wichering sne11ius

View GitHub Profile
//Scala xml -- this is supposed to return a collection of the elements to be modified
(e \ "_").find { child =>
(child \\ "_")
.filter { c =>
!isMedia(c.label)
}
.exists { c =>
c.child.exists { c =>
(singleParagraphs && isMedia(c.label)) || (c.label == "#PCDATA" && isEmpty(c.text))
}