aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs3
-rw-r--r--test/Tests/Writers/Muse.hs9
-rw-r--r--test/writer.muse2
3 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 404ebf7bc..ea46507db 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -287,7 +287,8 @@ conditionalEscapeString s =
if any (`elem` ("#*<=>[]|" :: String)) s ||
"::" `isInfixOf` s ||
"----" `isInfixOf` s ||
- "~~" `isInfixOf` s
+ "~~" `isInfixOf` s ||
+ "-" == s
then escapeString s
else s
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index 7aec8122a..ab5eaa205 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -301,6 +301,15 @@ tests = [ testGroup "block elements"
-- We don't want colons to be escaped if they can't be confused
-- with definition list item markers.
, "do not escape colon" =: str ":" =?> ":"
+ , "escape - to avoid accidental unordered lists" =: text " - foo" =?> " <verbatim>-</verbatim> foo"
+ , "escape - inside a list to avoid accidental nested unordered lists" =:
+ bulletList [ (para $ text "foo") <>
+ (para $ text "- bar")
+ ] =?>
+ unlines [ " - foo"
+ , ""
+ , " <verbatim>-</verbatim> bar"
+ ]
]
, testGroup "emphasis"
[ "emph" =: emph (text "foo") =?> "<em>foo</em>"
diff --git a/test/writer.muse b/test/writer.muse
index 6cb766955..5db3871a1 100644
--- a/test/writer.muse
+++ b/test/writer.muse
@@ -594,7 +594,7 @@ Bang: !
Plus: +
-Minus: -
+Minus: <verbatim>-</verbatim>
----