git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: escape hash symbol
commit454062eccdcc0047e6134bdd4d86c2debb0b3ce7 authorAlexander Krotov <ilabdsf@gmail.com> dateWed 22 Nov 2017, 16:01 (9 years ago) parentc8ab478
3 files changed+4−2
src/Text/Pandoc/Writers/Muse.hs+1−1 test/Tests/Writers/Muse.hs+2 test/writer.muse+1−1
src/Text/Pandoc/Writers/Muse.hs+1−1
@@ -285,7 +285,7 @@ escapeString s =
285285-- | Escape special characters for Muse if needed.
286286conditionalEscapeString :: String -> String
287287conditionalEscapeString s =
288− if any (`elem` ("*<=>[]|" :: String)) s ||
288+ if any (`elem` ("#*<=>[]|" :: String)) s ||
289289 "::" `isInfixOf` s ||
290290 "----" `isInfixOf` s
291291 then escapeString s
test/Tests/Writers/Muse.hs+2
@@ -279,6 +279,8 @@ tests = [ testGroup "block elements"
279279 =?> "<verbatim>foo<</verbatim><verbatim>/verbatim>bar</verbatim>"
280280 , "escape pipe to avoid accidental tables" =: str "foo | bar"
281281 =?> "<verbatim>foo | bar</verbatim>"
282+ , "escape hash to avoid accidental anchors" =: text "#foo bar"
283+ =?> "<verbatim>#foo</verbatim> bar"
282284 , "escape definition list markers" =: str "::" =?> "<verbatim>::</verbatim>"
283285 -- We don't want colons to be escaped if they can't be confused
284286 -- with definition list item markers.
test/writer.muse+1−1
@@ -589,7 +589,7 @@ Right paren: )
589589
590590Greater-than: <verbatim>></verbatim>
591591
592−Hash: #
592+Hash: <verbatim>#</verbatim>
593593
594594Period: .
595595