mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
Muse writer: escape semicolons and markers after line break
This commit is contained in:
@@ -382,7 +382,7 @@ renderInlineList True [] = pure "<verbatim></verbatim>"
|
||||
renderInlineList False [] = pure ""
|
||||
renderInlineList start (x:xs) = do r <- inlineToMuse x
|
||||
opts <- gets stOptions
|
||||
lst' <- renderInlineList (x == SoftBreak && writerWrapText opts == WrapPreserve) xs
|
||||
lst' <- renderInlineList ((x == SoftBreak && writerWrapText opts == WrapPreserve) || x == LineBreak) xs
|
||||
if start && fixOrEscape x
|
||||
then pure (text "<verbatim></verbatim>" <> r <> lst')
|
||||
else pure (r <> lst')
|
||||
|
||||
@@ -323,6 +323,7 @@ tests = [ testGroup "block elements"
|
||||
]
|
||||
, "escape ; to avoid accidental comments" =: text "; foo" =?> "<verbatim></verbatim>; foo"
|
||||
, "escape ; after softbreak" =: text "foo" <> softbreak <> text "; bar" =?> "foo\n<verbatim></verbatim>; bar"
|
||||
, "escape ; after linebreak" =: text "foo" <> linebreak <> text "; bar" =?> "foo<br>\n<verbatim></verbatim>; bar"
|
||||
]
|
||||
, testGroup "emphasis"
|
||||
[ "emph" =: emph (text "foo") =?> "<em>foo</em>"
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ item.
|
||||
Here’s one with a bullet. <verbatim>*</verbatim> criminey.
|
||||
|
||||
There should be a hard line break<br>
|
||||
here.
|
||||
<verbatim></verbatim>here.
|
||||
|
||||
----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user