git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: join strings during inline normalization
commit9dbd59a7c120eee9a0bbe292a05dd144987fa0a0 authorAlexander Krotov <ilabdsf@gmail.com> dateFri 2 Mar 2018, 01:39 (9 years ago) parent177c512
2 files changed+3
src/Text/Pandoc/Writers/Muse.hs+2 test/Tests/Writers/Muse.hs+1
src/Text/Pandoc/Writers/Muse.hs+2
@@ -294,6 +294,8 @@ conditionalEscapeString s =
294294normalizeInlineList :: [Inline] -> [Inline]
295295normalizeInlineList (x : Str "" : xs)
296296 = normalizeInlineList (x:xs)
297+normalizeInlineList (Str x1 : Str x2 : xs)
298+ = normalizeInlineList $ Str (x1 ++ x2) : xs
297299normalizeInlineList (Emph x1 : Emph x2 : ils)
298300 = normalizeInlineList $ Emph (x1 ++ x2) : ils
299301normalizeInlineList (Strong x1 : Strong x2 : ils)
test/Tests/Writers/Muse.hs+1
@@ -297,6 +297,7 @@ tests = [ testGroup "block elements"
297297 , "escape hash to avoid accidental anchors" =: text "#foo bar"
298298 =?> "<verbatim>#foo</verbatim> bar"
299299 , "escape definition list markers" =: str "::" =?> "<verbatim>::</verbatim>"
300+ , "normalize strings before escaping" =: fromList [Str ":", Str ":"] =?> "<verbatim>::</verbatim>"
300301 -- We don't want colons to be escaped if they can't be confused
301302 -- with definition list item markers.
302303 , "do not escape colon" =: str ":" =?> ":"