aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-07-12 14:51:21 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-07-12 14:51:21 -0700
commit9ae792b0d45469a9fd48ce546e88dd7f12ceda06 (patch)
tree326cb5be65f38f23e61a7dcf7fd6886bd334de25
parente3217c3862ca1c4fe2538f4fc4e137c993b57c1b (diff)
downloadpandoc-9ae792b0d45469a9fd48ce546e88dd7f12ceda06.tar.gz
Ms writer: fix code highlighting with blank lines.
Previously blank lines were simply omitted from highligted code.
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index 81de40045..d38b874d4 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -517,11 +517,11 @@ toMacro sty toktype =
msFormatter :: WriterOptions -> FormatOptions -> [SourceLine] -> Doc Text
msFormatter opts _fmtopts =
- vcat . map fmtLine
- where fmtLine = hcat . map fmtToken
- fmtToken (toktype, tok) = literal "\\*" <>
- brackets (literal (tshow toktype) <> literal " \""
- <> literal (escapeStr opts tok) <> literal "\"")
+ literal . T.intercalate "\n" . map fmtLine
+ where
+ fmtLine = mconcat . map fmtToken
+ fmtToken (toktype, tok) =
+ "\\*[" <> (tshow toktype) <> " \"" <> (escapeStr opts tok) <> "\"]"
highlightCode :: PandocMonad m => WriterOptions -> Attr -> Text -> MS m (Doc Text)
highlightCode opts attr str =