diff options
| author | John MacFarlane <[email protected]> | 2025-03-19 09:28:11 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-03-19 09:28:11 -0700 |
| commit | bfa81a52a5e2d487724867cf544be8af59250c7b (patch) | |
| tree | c3f049570adb28590ad3df01664c9f2e1f55f87e /src | |
| parent | 5882f2dae2b8ed95aeecc6cc9d5246179d3442b8 (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.hs | 8 |
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 } |
