@@ -67,7 +67,17 @@ writePlain opts document =
6767-- | Convert Pandoc to Commonmark.
6868writeCommonMark :: PandocMonad m => WriterOptions -> Pandoc -> m Text
6969writeCommonMark opts document =
70− evalMD (pandocToMarkdown opts document) def{ envVariant = Commonmark } def
70+ evalMD (pandocToMarkdown opts' document) def{ envVariant = Commonmark } def
71+ where
72+ opts' = opts{ writerExtensions =
73+ -- These extensions can't be enabled or disabled
74+ -- for commonmark because they're part of the core;
75+ -- we set them here so that escapeText will behave
76+ -- properly.
77+ enableExtension Ext_all_symbols_escapable $
78+ enableExtension Ext_pipe_tables $
79+ enableExtension Ext_intraword_underscores $
80+ writerExtensions opts }
7181
7282pandocTitleBlock :: Doc Text -> [Doc Text] -> Doc Text -> Doc Text
7383pandocTitleBlock tit auths dat =