git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: improve inline normalization
commitbd3feb864fb482a074f0c9930d479e01621f3132 authorAlexander Krotov <ilabdsf@gmail.com> dateFri 24 Nov 2017, 12:28 (9 years ago) parent0cfd764
1 file changed+14
src/Text/Pandoc/Writers/Muse.hs+14
src/Text/Pandoc/Writers/Muse.hs+14
@@ -292,10 +292,24 @@ conditionalEscapeString s =
292292 else s
293293
294294normalizeInlineList :: [Inline] -> [Inline]
295+normalizeInlineList (Emph x1 : Emph x2 : ils)
296+ = normalizeInlineList $ Emph (x1 ++ x2) : ils
297+normalizeInlineList (Strong x1 : Strong x2 : ils)
298+ = normalizeInlineList $ Strong (x1 ++ x2) : ils
299+normalizeInlineList (Strikeout x1 : Strikeout x2 : ils)
300+ = normalizeInlineList $ Strikeout (x1 ++ x2) : ils
301+normalizeInlineList (Superscript x1 : Superscript x2 : ils)
302+ = normalizeInlineList $ Superscript (x1 ++ x2) : ils
303+normalizeInlineList (Subscript x1 : Subscript x2 : ils)
304+ = normalizeInlineList $ Subscript (x1 ++ x2) : ils
305+normalizeInlineList (SmallCaps x1 : SmallCaps x2 : ils)
306+ = normalizeInlineList $ SmallCaps (x1 ++ x2) : ils
295307normalizeInlineList (Code a1 x1 : Code a2 x2 : ils) | a1 == a2
296308 = normalizeInlineList $ Code a1 (x1 ++ x2) : ils
297309normalizeInlineList (RawInline f1 x1 : RawInline f2 x2 : ils) | f1 == f2
298310 = normalizeInlineList $ RawInline f1 (x1 ++ x2) : ils
311+normalizeInlineList (Span a1 x1 : Span a2 x2 : ils) | a1 == a2
312+ = normalizeInlineList $ Span a1 (x1 ++ x2) : ils
299313normalizeInlineList (x:xs) = x : normalizeInlineList xs
300314normalizeInlineList [] = []
301315