git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: escape > less often

> should be escaped only when it can start verse, i.e., at the beginning of the line.

commit782ab73aa350ca323b0b7786770e37d1a932f9a8 authorAlexander Krotov <ilabdsf@gmail.com> dateTue 10 Apr 2018, 23:38 (9 years ago) parent72878ad
3 files changed+6−4
src/Text/Pandoc/Writers/Muse.hs+2−1 test/Tests/Writers/Muse.hs+1 test/writer.muse+3−3
src/Text/Pandoc/Writers/Muse.hs+2−1
@@ -324,7 +324,7 @@ containsFootnotes st =
324324
325325conditionalEscapeString :: Bool -> String -> String
326326conditionalEscapeString isInsideLinkDescription s =
327− if any (`elem` ("#*<=>|" :: String)) s ||
327+ if any (`elem` ("#*<=|" :: String)) s ||
328328 "::" `isInfixOf` s ||
329329 "~~" `isInfixOf` s ||
330330 "[[" `isInfixOf` s ||
@@ -403,6 +403,7 @@ isHorizontalRule s =
403403fixOrEscape :: Bool -> Inline -> Bool
404404fixOrEscape sp (Str "-") = sp
405405fixOrEscape sp (Str ";") = not sp
406+fixOrEscape _ (Str ">") = True
406407fixOrEscape sp (Str s) = (sp && (startsWithMarker isDigit s ||
407408 startsWithMarker isAsciiLower s ||
408409 startsWithMarker isAsciiUpper s))
test/Tests/Writers/Muse.hs+1
@@ -264,6 +264,7 @@ tests = [ testGroup "block elements"
264264 , "escape long horizontal rule" =: para (text "----------") =?> "<verbatim></verbatim>----------"
265265 , "don't escape horizontal inside paragraph" =: para (text "foo ---- bar") =?> "foo ---- bar"
266266 , "escape nonbreaking space" =: para (text "~~") =?> "<verbatim>~~</verbatim>"
267+ , "escape > in the beginning of line" =: para (text "> foo bar") =?> "<verbatim></verbatim>> foo bar"
267268 , testGroup "tables"
268269 [ "table without header" =:
269270 let rows = [[para $ text "Para 1.1", para $ text "Para 1.2"]
test/writer.muse+3−3
@@ -79,7 +79,7 @@ nested
7979</quote>
8080</quote>
8181
82−This should not be a block quote: 2 <verbatim>></verbatim> 1.
82+This should not be a block quote: 2 > 1.
8383
8484And a following paragraph.
8585
@@ -562,7 +562,7 @@ This & that.
562562
5635634 <verbatim><</verbatim> 5.
564564
565−6 <verbatim>></verbatim> 5.
565+6 > 5.
566566
567567Backslash: \
568568
@@ -584,7 +584,7 @@ Left paren: (
584584
585585Right paren: )
586586
587−Greater-than: <verbatim>></verbatim>
587+Greater-than: >
588588
589589Hash: <verbatim>#</verbatim>
590590