aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-03-19 09:28:11 -0700
committerJohn MacFarlane <[email protected]>2025-03-19 09:28:11 -0700
commitbfa81a52a5e2d487724867cf544be8af59250c7b (patch)
treec3f049570adb28590ad3df01664c9f2e1f55f87e /src
parent5882f2dae2b8ed95aeecc6cc9d5246179d3442b8 (diff)
T.P.Readers.Docx.Util: use xml-lights's `onlyElems`...
...instead of defining it again.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Util.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Util.hs b/src/Text/Pandoc/Readers/Docx/Util.hs
index 73f3dd9cc..88c1973f9 100644
--- a/src/Text/Pandoc/Readers/Docx/Util.hs
+++ b/src/Text/Pandoc/Readers/Docx/Util.hs
@@ -79,13 +79,7 @@ extractChildren el condition
| otherwise = Just (modifiedElement, removedChildren) -- Children removed, return Just
where
-- Separate the children based on the condition
- (removedChildren, keptChildren) = partition condition (onlyElems' $ elContent el)
-
- -- Helper function to filter only Element types from Content
- onlyElems' :: [Content] -> [Element]
- onlyElems' = foldr (\c acc -> case c of
- Elem e -> e : acc
- _ -> acc) []
+ (removedChildren, keptChildren) = partition condition (onlyElems $ elContent el)
-- Reconstruct the element with the kept children
modifiedElement = el { elContent = map Elem keptChildren }