aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-01-22 16:27:14 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-01-22 16:27:14 +0300
commite9ed4832edb1a9f9c3cd7b6c670c39f513444192 (patch)
treebcbf7bbee8e0c9beddfc5ea01f6eea1f54ed27cb
parent288065cfd44eb02f9ef4e6c9b901e14776246dbb (diff)
downloadpandoc-e9ed4832edb1a9f9c3cd7b6c670c39f513444192.tar.gz
Muse writer: join code with different attributes during normalization
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs4
-rw-r--r--test/Tests/Writers/Muse.hs1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 23aa98866..164a46411 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -307,8 +307,8 @@ normalizeInlineList (Subscript x1 : Subscript x2 : ils)
= normalizeInlineList $ Subscript (x1 ++ x2) : ils
normalizeInlineList (SmallCaps x1 : SmallCaps x2 : ils)
= normalizeInlineList $ SmallCaps (x1 ++ x2) : ils
-normalizeInlineList (Code a1 x1 : Code a2 x2 : ils) | a1 == a2
- = normalizeInlineList $ Code a1 (x1 ++ x2) : ils
+normalizeInlineList (Code _ x1 : Code _ x2 : ils)
+ = normalizeInlineList $ Code nullAttr (x1 ++ x2) : ils
normalizeInlineList (RawInline f1 x1 : RawInline f2 x2 : ils) | f1 == f2
= normalizeInlineList $ RawInline f1 (x1 ++ x2) : ils
normalizeInlineList (Span a1 x1 : Span a2 x2 : ils) | a1 == a2
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index ee4c76587..51b811fa3 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -316,6 +316,7 @@ tests = [ testGroup "block elements"
, testGroup "code"
[ "simple" =: code "foo" =?> "<code>foo</code>"
, "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>"
]
, testGroup "spaces"