From 1d57f7a641e9c66d56cab20905a602202336fbad Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 28 Feb 2018 14:26:11 +0300 Subject: Muse writer: remove empty strings during inline normalization --- src/Text/Pandoc/Writers/Muse.hs | 2 ++ test/Tests/Writers/Muse.hs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index b4eb19ef6..4086bdd9c 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -299,6 +299,8 @@ conditionalEscapeString s = else s normalizeInlineList :: [Inline] -> [Inline] +normalizeInlineList (x : Str "" : xs) + = normalizeInlineList (x:xs) normalizeInlineList (Emph x1 : Emph x2 : ils) = normalizeInlineList $ Emph (x1 ++ x2) : ils normalizeInlineList (Strong x1 : Strong x2 : ils) diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 7aee36217..bbf833563 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -319,6 +319,7 @@ tests = [ testGroup "block elements" , "escape tag" =: code "foo = bar baz" =?> "foo = bar</code> baz" , "normalization with attributes" =: codeWith ("",["haskell"],[]) "foo" <> code "bar" =?> "foobar" , "normalization" =: code " code "de>" =?> "</code>" + , "normalization with empty string" =: code " str "" <> code "de>" =?> "</code>" ] , testGroup "spaces" [ "space" =: text "a" <> space <> text "b" =?> "a b" -- cgit v1.2.3