Muse writer: escape semicolons and markers after line break

This commit is contained in:
Alexander Krotov
2018-03-28 13:19:39 +03:00
parent c24ecf9cd9
commit b379a2903a
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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')
+1
View File
@@ -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
View File
@@ -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.
----