aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-05-09 11:40:09 -0700
committerJohn MacFarlane <[email protected]>2023-05-09 11:40:09 -0700
commitf1233888c591edb7eace135deaab9bbe1f22a09f (patch)
tree6900d2a698c0ee9d1132256a692cb8649abc441c
parent05ad84a0c6c027c2c78bdb3ec0e25864d8725efd (diff)
Ms writer: coerce titles to inlines.
Block-level formatting is not allowed inside .TL. Closes #8835.
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index ea869c284..543b69337 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -63,6 +63,7 @@ pandocToMs opts (Pandoc meta blocks) = do
let colwidth = if writerWrapText opts == WrapAuto
then Just $ writerColumns opts
else Nothing
+ title <- chomp <$> inlineListToMs' opts (lookupMetaInlines "title" meta)
metadata <- metaToContext opts
(blockListToMs opts)
(fmap chomp . inlineListToMs' opts)
@@ -82,7 +83,8 @@ pandocToMs opts (Pandoc meta blocks) = do
$ defField "toc" (writerTableOfContents opts)
$ defField "title-meta" titleMeta
$ defField "author-meta" (T.intercalate "; " authorsMeta)
- $ defField "highlighting-macros" highlightingMacros metadata
+ $ defField "highlighting-macros" highlightingMacros
+ $ resetField "title" title metadata
return $ render colwidth $
case writerTemplate opts of
Nothing -> main