aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-02-28 14:26:11 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-02-28 14:26:11 +0300
commit1d57f7a641e9c66d56cab20905a602202336fbad (patch)
tree6149c423a2ccac8dfd3e75c7d366c3f00f4842fc
parenta7ac590b083f98bc6c98530077f0ed78e232bc0d (diff)
downloadpandoc-1d57f7a641e9c66d56cab20905a602202336fbad.tar.gz
Muse writer: remove empty strings during inline normalization
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs2
-rw-r--r--test/Tests/Writers/Muse.hs1
2 files changed, 3 insertions, 0 deletions
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 "<code>foo = bar</code> baz" =?> "<code><code>foo = bar<</code><code>/code> baz</code>"
, "normalization with attributes" =: codeWith ("",["haskell"],[]) "foo" <> code "bar" =?> "<code>foobar</code>"
, "normalization" =: code "</co" <> code "de>" =?> "<code><</code><code>/code></code>"
+ , "normalization with empty string" =: code "</co" <> str "" <> code "de>" =?> "<code><</code><code>/code></code>"
]
, testGroup "spaces"
[ "space" =: text "a" <> space <> text "b" =?> "a b"