diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-24 12:28:09 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-24 12:35:25 +0300 |
commit | bd3feb864fb482a074f0c9930d479e01621f3132 (patch) | |
tree | 4ebe0dd5160ee11c7a8166afc71e864bb17adb91 /src/Text/Pandoc | |
parent | 0cfd764d27bc03b59871e477d6bfd7341f4916b0 (diff) | |
download | pandoc-bd3feb864fb482a074f0c9930d479e01621f3132.tar.gz |
Muse writer: improve inline normalization
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index ed5ad5793..ccda8edf1 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -292,10 +292,24 @@ conditionalEscapeString s = else s normalizeInlineList :: [Inline] -> [Inline] +normalizeInlineList (Emph x1 : Emph x2 : ils) + = normalizeInlineList $ Emph (x1 ++ x2) : ils +normalizeInlineList (Strong x1 : Strong x2 : ils) + = normalizeInlineList $ Strong (x1 ++ x2) : ils +normalizeInlineList (Strikeout x1 : Strikeout x2 : ils) + = normalizeInlineList $ Strikeout (x1 ++ x2) : ils +normalizeInlineList (Superscript x1 : Superscript x2 : ils) + = normalizeInlineList $ Superscript (x1 ++ x2) : ils +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 (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 + = normalizeInlineList $ Span a1 (x1 ++ x2) : ils normalizeInlineList (x:xs) = x : normalizeInlineList xs normalizeInlineList [] = [] |