git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: set envInsideBlock = True when rendering notes
1aac754Alexander Krotov
src/Text/Pandoc/Writers/Muse.hs+2−1
@@ -293,7 +293,8 @@ noteToMuse :: PandocMonad m
293 -> Muse m Doc
293 -> Muse m Doc
294noteToMuse num note =
294noteToMuse num note =
295 hang (length marker) (text marker) <$>
295 hang (length marker) (text marker) <$>
296+ (local (\env -> env { envInsideBlock = True
296− (local (\env -> env { envInlineStart = True
297+ , envInlineStart = True
297 , envAfterSpace = True
298 , envAfterSpace = True
298 }) $ blockListToMuse note)
299 }) $ blockListToMuse note)
299 where
300 where
test/Tests/Writers/Muse.hs+7
@@ -363,6 +363,13 @@ tests = [ testGroup "block elements"
363 , ""
363 , ""
364 , "[1] <verbatim></verbatim>- foo"
364 , "[1] <verbatim></verbatim>- foo"
365 ]
365 ]
366+ , "escape - after softbreak in note" =:
367+ note (para (str "foo" <> softbreak <> str "- bar")) =?>
368+ unlines [ "[1]"
369+ , ""
370+ , "[1] foo"
371+ , " <verbatim></verbatim>- bar"
372+ ]
366 , "escape ; to avoid accidental comments" =: text "; foo" =?> "<verbatim></verbatim>; foo"
373 , "escape ; to avoid accidental comments" =: text "; foo" =?> "<verbatim></verbatim>; foo"
367 , "escape strings starting with ; and space" =: str "; foo" =?> "<verbatim></verbatim>; foo"
374 , "escape strings starting with ; and space" =: str "; foo" =?> "<verbatim></verbatim>; foo"
368 , "escape ; after softbreak" =: text "foo" <> softbreak <> text "; bar" =?> "foo\n<verbatim></verbatim>; bar"
375 , "escape ; after softbreak" =: text "foo" <> softbreak <> text "; bar" =?> "foo\n<verbatim></verbatim>; bar"