Muse writer: escape hash symbol

This commit is contained in:
Alexander Krotov
2017-11-22 16:17:30 +03:00
parent c8ab4789b6
commit 454062eccd
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -285,7 +285,7 @@ escapeString s =
-- | Escape special characters for Muse if needed.
conditionalEscapeString :: String -> String
conditionalEscapeString s =
if any (`elem` ("*<=>[]|" :: String)) s ||
if any (`elem` ("#*<=>[]|" :: String)) s ||
"::" `isInfixOf` s ||
"----" `isInfixOf` s
then escapeString s
+2
View File
@@ -279,6 +279,8 @@ tests = [ testGroup "block elements"
=?> "<verbatim>foo<</verbatim><verbatim>/verbatim>bar</verbatim>"
, "escape pipe to avoid accidental tables" =: str "foo | bar"
=?> "<verbatim>foo | bar</verbatim>"
, "escape hash to avoid accidental anchors" =: text "#foo bar"
=?> "<verbatim>#foo</verbatim> bar"
, "escape definition list markers" =: str "::" =?> "<verbatim>::</verbatim>"
-- We don't want colons to be escaped if they can't be confused
-- with definition list item markers.
+1 -1
View File
@@ -589,7 +589,7 @@ Right paren: )
Greater-than: <verbatim>></verbatim>
Hash: #
Hash: <verbatim>#</verbatim>
Period: .