aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-07-21 11:04:13 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-21 10:04:13 +0200
commit335a1c7f4867f7cd3575f07b5efa75712d59d1ac (patch)
tree9849b9e1eb01d5d5eedfa60d32c4c7a336eb0fb8 /src/Text/Pandoc/Readers
parent7191fe1f29f2f8b45f9be7e0f8bc9ed889e431d2 (diff)
downloadpandoc-335a1c7f4867f7cd3575f07b5efa75712d59d1ac.tar.gz
Muse reader: fix reading of lists inside tags (#3802)
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 1ae73c148..9d967a9de 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -115,11 +115,10 @@ htmlElement :: PandocMonad m => String -> MuseParser m (Attr, String)
htmlElement tag = try $ do
(TagOpen _ attr, _) <- htmlTag (~== TagOpen tag [])
content <- manyTill anyChar (endtag <|> endofinput)
- return (htmlAttrToPandoc attr, trim content)
+ return (htmlAttrToPandoc attr, content)
where
endtag = void $ htmlTag (~== TagClose tag)
endofinput = lookAhead $ try $ skipMany blankline >> skipSpaces >> eof
- trim = dropWhile (=='\n') . reverse . dropWhile (=='\n') . reverse
htmlAttrToPandoc :: [Attribute String] -> Attr
htmlAttrToPandoc attrs = (ident, classes, keyvals)
@@ -132,7 +131,7 @@ parseHtmlContentWithAttrs :: PandocMonad m
=> String -> MuseParser m a -> MuseParser m (Attr, [a])
parseHtmlContentWithAttrs tag parser = do
(attr, content) <- htmlElement tag
- parsedContent <- try $ parseContent content
+ parsedContent <- try $ parseContent (content ++ "\n")
return (attr, parsedContent)
where
parseContent = parseFromString $ nested $ manyTill parser endOfContent