git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: use lightweight markup after </em> tag
commita98e2b7c42d6ac9062677bf6d76caa3cf854dd9c authorAlexander Krotov <ilabdsf@gmail.com> dateSun 21 Oct 2018, 20:19 (8 years ago) parent3ec0b78
2 files changed+4
src/Text/Pandoc/Writers/Muse.hs+1 test/Tests/Writers/Muse.hs+3
src/Text/Pandoc/Writers/Muse.hs+1
@@ -548,6 +548,7 @@ inlineToMuse (Emph lst) = do
548548 let lst' = normalizeInlineList lst
549549 if useTags || null lst' || startsWithSpace lst' || endsWithSpace lst'
550550 then do contents <- inlineListToMuse lst'
551+ modify $ \st -> st { stUseTags = False }
551552 return $ "<em>" <> contents <> "</em>"
552553 else do contents <- local (\env -> env { envInsideAsterisks = True }) $ inlineListToMuse lst'
553554 modify $ \st -> st { stUseTags = True }
test/Tests/Writers/Muse.hs+3
@@ -400,6 +400,9 @@ tests = [ testGroup "block elements"
400400 , "strong after emphasis" =: emph (text "foo") <> strong (text "bar") =?> "*foo*<strong>bar</strong>"
401401 , "strong emphasis after emphasis" =: emph (text "foo") <> strong (emph (text "bar")) =?> "*foo*<strong>*bar*</strong>"
402402 , "strong in the end of emphasis" =: emph (text "foo" <> strong (text "bar")) =?> "*foo<strong>bar</strong>*"
403+ , "switch to lightweight markup after <em> tag" =:
404+ strong (str "foo") <> emph (str "bar") <> strong (str "baz") =?>
405+ "**foo**<em>bar</em>**baz**"
403406 , "strikeout" =: strikeout (text "foo") =?> "<del>foo</del>"
404407 , "space at the beginning of emphasis" =: emph (text " foo") =?> "<em> foo</em>"
405408 , "space at the end of emphasis" =: emph (text "foo ") =?> "<em>foo </em>"