From cb28cab489279c48f0afd7113a75ccd96f43eaba Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 11 Sep 2018 11:35:25 +0300 Subject: Muse writer: escape -, ; and > in the beginning of strings --- test/Tests/Writers/Muse.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 7821f4e96..a8ccd6d87 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -283,6 +283,7 @@ tests = [ testGroup "block elements" , "don't escape horizontal inside paragraph" =: para (text "foo ---- bar") =?> "foo ---- bar" , "escape nonbreaking space" =: para (text "~~") =?> "~~" , "escape > in the beginning of line" =: para (text "> foo bar") =?> "> foo bar" + , "escape string with > and space in the beginning of line" =: para (str "> foo bar") =?> "> foo bar" , testGroup "tables" [ "table without header" =: let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"] @@ -348,6 +349,14 @@ tests = [ testGroup "block elements" , "" , " - bar" ] + , "escape strings starting with - inside a list" =: + bulletList [ para (str "foo") <> + para (str "- bar") + ] =?> + unlines [ " - foo" + , "" + , " - bar" + ] , "escape - inside a note" =: note (para (text "- foo")) =?> unlines [ "[1]" @@ -355,6 +364,7 @@ tests = [ testGroup "block elements" , "[1] - foo" ] , "escape ; to avoid accidental comments" =: text "; foo" =?> "; foo" + , "escape strings starting with ; and space" =: str "; foo" =?> "; foo" , "escape ; after softbreak" =: text "foo" <> softbreak <> text "; bar" =?> "foo\n; bar" , "escape ; after linebreak" =: text "foo" <> linebreak <> text "; bar" =?> "foo
\n; bar" , "do not escape ; inside paragraph" =: text "foo ; bar" =?> "foo ; bar" -- cgit v1.2.3