Muse writer: escape nonbreaking space ("~~")

This commit is contained in:
Alexander Krotov 2018-01-29 12:54:43 +03:00
parent 37271fabee
commit b7d8930dc0
2 changed files with 3 additions and 1 deletions

View file

@ -290,7 +290,8 @@ conditionalEscapeString :: String -> String
conditionalEscapeString s = conditionalEscapeString s =
if any (`elem` ("#*<=>[]|" :: String)) s || if any (`elem` ("#*<=>[]|" :: String)) s ||
"::" `isInfixOf` s || "::" `isInfixOf` s ||
"----" `isInfixOf` s "----" `isInfixOf` s ||
"~~" `isInfixOf` s
then escapeString s then escapeString s
else s else s

View file

@ -251,6 +251,7 @@ tests = [ testGroup "block elements"
] ]
, "horizontal rule" =: horizontalRule =?> "----" , "horizontal rule" =: horizontalRule =?> "----"
, "escape horizontal rule" =: para (text "----") =?> "<verbatim>----</verbatim>" , "escape horizontal rule" =: para (text "----") =?> "<verbatim>----</verbatim>"
, "escape nonbreaking space" =: para (text "~~") =?> "<verbatim>~~</verbatim>"
, testGroup "tables" , testGroup "tables"
[ "table without header" =: [ "table without header" =:
let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"] let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"]