mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 09:47:06 +00:00
Muse writer: escape hash symbol
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -589,7 +589,7 @@ Right paren: )
|
||||
|
||||
Greater-than: <verbatim>></verbatim>
|
||||
|
||||
Hash: #
|
||||
Hash: <verbatim>#</verbatim>
|
||||
|
||||
Period: .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user