Skip to content

Commit bfa81a5

Browse files
committed
T.P.Readers.Docx.Util: use xml-lights's onlyElems...
...instead of defining it again.
1 parent 5882f2d commit bfa81a5

File tree

1 file changed

+1
-7
lines changed
  • src/Text/Pandoc/Readers/Docx

1 file changed

+1
-7
lines changed

src/Text/Pandoc/Readers/Docx/Util.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,7 @@ extractChildren el condition
7979
| otherwise = Just (modifiedElement, removedChildren) -- Children removed, return Just
8080
where
8181
-- 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) []
82+
(removedChildren, keptChildren) = partition condition (onlyElems $ elContent el)
8983

9084
-- Reconstruct the element with the kept children
9185
modifiedElement = el { elContent = map Elem keptChildren }

0 commit comments

Comments
 (0)