diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 4 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index f64f9d04f..74622a639 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -129,7 +129,7 @@ parseHtmlContentWithAttrs :: PandocMonad m => String -> MuseParser m a -> MuseParser m (Attr, [a]) parseHtmlContentWithAttrs tag parser = do (attr, content) <- htmlElement tag - parsedContent <- try $ parseContent (content ++ "\n") + parsedContent <- parseContent (content ++ "\n") return (attr, parsedContent) where parseContent = parseFromString $ nested $ manyTill parser endOfContent @@ -536,7 +536,7 @@ inlineTag :: PandocMonad m => (Inlines -> Inlines) -> String -> MuseParser m (F Inlines) -inlineTag f s = do +inlineTag f s = try $ do res <- parseHtmlContent s inline return $ f <$> mconcat res diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index dac980c90..8d4ad0b15 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -60,6 +60,16 @@ tests = , "Tag soup" =: "foo <em> bar </strong>baz" =?> para "foo <em> bar </strong>baz" + -- Both inline tags must be within the same paragraph + , "No multiparagraph inline tags" =: + T.unlines [ "First line" + , "<em>Second line" + , "" + , "Fourth line</em>" + ] =?> + para "First line <em>Second line" <> + para "Fourth line</em>" + , "Linebreak" =: "Line <br> break" =?> para ("Line" <> linebreak <> "break") , "Code" =: "=foo(bar)=" =?> para (code "foo(bar)") |