diff options
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 3 | ||||
-rw-r--r-- | test/Tests/Writers/Muse.hs | 1 | ||||
-rw-r--r-- | test/writer.muse | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 0cfc2b8c4..127a4f149 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -324,7 +324,7 @@ containsFootnotes st = conditionalEscapeString :: Bool -> String -> String conditionalEscapeString isInsideLinkDescription s = - if any (`elem` ("#*<=>|" :: String)) s || + if any (`elem` ("#*<=|" :: String)) s || "::" `isInfixOf` s || "~~" `isInfixOf` s || "[[" `isInfixOf` s || @@ -403,6 +403,7 @@ isHorizontalRule s = fixOrEscape :: Bool -> Inline -> Bool fixOrEscape sp (Str "-") = sp fixOrEscape sp (Str ";") = not sp +fixOrEscape _ (Str ">") = True fixOrEscape sp (Str s) = (sp && (startsWithMarker isDigit s || startsWithMarker isAsciiLower s || startsWithMarker isAsciiUpper s)) diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 5d84150e1..41c846b1b 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -264,6 +264,7 @@ tests = [ testGroup "block elements" , "escape long horizontal rule" =: para (text "----------") =?> "<verbatim></verbatim>----------" , "don't escape horizontal inside paragraph" =: para (text "foo ---- bar") =?> "foo ---- bar" , "escape nonbreaking space" =: para (text "~~") =?> "<verbatim>~~</verbatim>" + , "escape > in the beginning of line" =: para (text "> foo bar") =?> "<verbatim></verbatim>> foo bar" , testGroup "tables" [ "table without header" =: let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"] diff --git a/test/writer.muse b/test/writer.muse index 83a53a1ab..9492a5517 100644 --- a/test/writer.muse +++ b/test/writer.muse @@ -79,7 +79,7 @@ nested </quote> </quote> -This should not be a block quote: 2 <verbatim>></verbatim> 1. +This should not be a block quote: 2 > 1. And a following paragraph. @@ -562,7 +562,7 @@ This & that. 4 <verbatim><</verbatim> 5. -6 <verbatim>></verbatim> 5. +6 > 5. Backslash: \ @@ -584,7 +584,7 @@ Left paren: ( Right paren: ) -Greater-than: <verbatim>></verbatim> +Greater-than: > Hash: <verbatim>#</verbatim> |