diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2014-06-25 11:00:15 -0400 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2014-06-25 11:00:15 -0400 |
commit | 9614ddfedc18cccbf9fbe1a23fae200c7e67d72d (patch) | |
tree | 38c552d8776dd53d0603c2136542e6162cda74de /src/Text/Pandoc/Readers | |
parent | ed44e4ca8c8f3d3c4c7ac65b98f16732c8173b88 (diff) | |
download | pandoc-9614ddfedc18cccbf9fbe1a23fae200c7e67d72d.tar.gz |
Docx reader: Remove unnecessary filter in Parse.
mapMaybe does the filtering for us.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx/Parse.hs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index c76ef7511..dbbd65681 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -281,10 +281,6 @@ elemToBody ns element | qName (elName element) == "body" && qURI (elName element $ map (elemToBodyPart ns) $ filterChildrenName (isParOrTbl ns) element elemToBody _ _ = Nothing -isRunOrLinkOrBookmark :: NameSpaces -> QName -> Bool -isRunOrLinkOrBookmark ns q = qName q `elem` ["r", "hyperlink", "bookmarkStart"] && - qURI q == (lookup "w" ns) - elemToNumInfo :: NameSpaces -> Element -> Maybe (String, String) elemToNumInfo ns element | qName (elName element) == "p" && @@ -319,9 +315,8 @@ elemToBodyPart ns element | qName (elName element) == "p" && qURI (elName element) == (lookup "w" ns) = let parstyle = elemToParagraphStyle ns element - parparts = mapMaybe id - $ map (elemToParPart ns) - $ filterChildrenName (isRunOrLinkOrBookmark ns) element + parparts = mapMaybe (elemToParPart ns) + $ elChildren element in case elemToNumInfo ns element of Just (numId, lvl) -> Just $ ListItem parstyle numId lvl parparts |