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 =
if any (`elem` ("#*<=>[]|" :: String)) s ||
"::" `isInfixOf` s ||
"----" `isInfixOf` s
"----" `isInfixOf` s ||
"~~" `isInfixOf` s
then escapeString s
else s

View file

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