git.iko.soy/typeable/pandoc
on master help sign in
Ms writer: fix code highlighting with blank lines.

Previously blank lines were simply omitted from highligted code.

commit214d7a9dc912002282bc43e0078a7f0811a82ebf authorJohn MacFarlane <jgm@berkeley.edu> dateSun 12 Jul 2020, 14:51 (6 years ago) parenta0bd561
1 file changed+5−5
src/Text/Pandoc/Writers/Ms.hs+5−5
src/Text/Pandoc/Writers/Ms.hs+5−5
@@ -517,11 +517,11 @@ toMacro sty toktype =
517517
518518msFormatter :: WriterOptions -> FormatOptions -> [SourceLine] -> Doc Text
519519msFormatter opts _fmtopts =
520− vcat . map fmtLine
521− where fmtLine = hcat . map fmtToken
522− fmtToken (toktype, tok) = literal "\\*" <>
523− brackets (literal (tshow toktype) <> literal " \""
524− <> literal (escapeStr opts tok) <> literal "\"")
520+ literal . T.intercalate "\n" . map fmtLine
521+ where
522+ fmtLine = mconcat . map fmtToken
523+ fmtToken (toktype, tok) =
524+ "\\*[" <> (tshow toktype) <> " \"" <> (escapeStr opts tok) <> "\"]"
525525
526526highlightCode :: PandocMonad m => WriterOptions -> Attr -> Text -> MS m (Doc Text)
527527highlightCode opts attr str =