aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/OPML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-20 21:52:13 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-20 21:52:13 +0200
commit2363e6a15bdde1c206d65461bd2e21f773dbc808 (patch)
treec4e1879cd8d4cfa17c3f6cab1aa009ceb20f5ae3 /src/Text/Pandoc/Readers/OPML.hs
parent4ba5ef46aeaf979bd74d8f4a5f6cea116527ddd3 (diff)
downloadpandoc-2363e6a15bdde1c206d65461bd2e21f773dbc808.tar.gz
Move CR filtering from tabFilter to the readers.
The readers previously assumed that CRs had been filtered from the input. Now we strip the CRs in the readers themselves, before parsing. (The point of this is just to simplify the parsers.) Shared now exports a new function `crFilter`. [API change] And `tabFilter` no longer filters CRs.
Diffstat (limited to 'src/Text/Pandoc/Readers/OPML.hs')
-rw-r--r--src/Text/Pandoc/Readers/OPML.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/OPML.hs b/src/Text/Pandoc/Readers/OPML.hs
index e9f876525..c25ace800 100644
--- a/src/Text/Pandoc/Readers/OPML.hs
+++ b/src/Text/Pandoc/Readers/OPML.hs
@@ -9,6 +9,7 @@ import Text.HTML.TagSoup.Entity (lookupEntity)
import Text.Pandoc.Builder
import Text.Pandoc.Class (PandocMonad)
import Text.Pandoc.Options
+import Text.Pandoc.Shared (crFilter)
import Text.Pandoc.Readers.HTML (readHtml)
import Text.Pandoc.Readers.Markdown (readMarkdown)
import Text.XML.Light
@@ -32,7 +33,8 @@ instance Default OPMLState where
readOPML :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
readOPML _ inp = do
(bs, st') <- flip runStateT def
- (mapM parseBlock $ normalizeTree $ parseXML (unpack inp))
+ (mapM parseBlock $ normalizeTree $
+ parseXML (unpack (crFilter inp)))
return $
setTitle (opmlDocTitle st') $
setAuthors (opmlDocAuthors st') $