We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
onlyElems
1 parent 5882f2d commit bfa81a5Copy full SHA for bfa81a5
src/Text/Pandoc/Readers/Docx/Util.hs
@@ -79,13 +79,7 @@ extractChildren el condition
79
| otherwise = Just (modifiedElement, removedChildren) -- Children removed, return Just
80
where
81
-- Separate the children based on the condition
82
- (removedChildren, keptChildren) = partition condition (onlyElems' $ elContent el)
83
-
84
- -- Helper function to filter only Element types from Content
85
- onlyElems' :: [Content] -> [Element]
86
- onlyElems' = foldr (\c acc -> case c of
87
- Elem e -> e : acc
88
- _ -> acc) []
+ (removedChildren, keptChildren) = partition condition (onlyElems $ elContent el)
89
90
-- Reconstruct the element with the kept children
91
modifiedElement = el { elContent = map Elem keptChildren }
0 commit comments