From 6337539e32cb1728e4cd9e6b1cce7313aaf04f03 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 24 Jan 2018 14:16:56 +0300 Subject: Muse reader: fix matching of closing inline tags --- src/Text/Pandoc/Readers/Muse.hs | 5 +++-- test/Tests/Readers/Muse.hs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index a9c0162d2..b64d877b3 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -658,8 +658,9 @@ inlineTag :: PandocMonad m => (Inlines -> Inlines) -> String -> MuseParser m (F Inlines) -inlineTag f s = try $ do - res <- parseHtmlContent s inline +inlineTag f tag = try $ do + htmlTag (~== TagOpen tag []) + res <- manyTill inline (void $ htmlTag (~== TagClose tag)) return $ f <$> mconcat res strongTag :: PandocMonad m => MuseParser m (F Inlines) diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 36b08c3a2..0ceed0322 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -171,6 +171,9 @@ tests = , "Verbatim tag after text" =: "Foo bar" =?> para "Foo bar" + -- tag should match with the last tag, not verbatim one + , "Nested \"\" inside em tag" =: "foobar" =?> para (emph ("foobar")) + , testGroup "Links" [ "Link without description" =: "[[https://amusewiki.org/]]" =?> -- cgit v1.2.3