diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-09-02 20:36:57 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-02 20:36:57 -0700 |
commit | d79242796b5bfa24788d30b239de3b15c0ed326c (patch) | |
tree | 676099d7c5601b8e234f01e61ad3644da43bdf21 /src | |
parent | 5e708eb8ce4bb4325b009ac37a5986517d6b9290 (diff) | |
download | pandoc-d79242796b5bfa24788d30b239de3b15c0ed326c.tar.gz |
HTML writer: use numeric character references with `--ascii`.
Previously we used named character references with html5 output.
But these aren't valid XML, and we aim to produce html5 that is
also valid XHTML (polyglot markup). (This is also needed for
epub3.)
Closes #5718.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index af0780e99..38b0e1974 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -59,8 +59,7 @@ import Text.DocTemplates (Context(..)) import Text.Pandoc.Walk import Text.Pandoc.Writers.Math import Text.Pandoc.Writers.Shared -import Text.Pandoc.XML (escapeStringForXML, fromEntities, - toEntities, toHtml5Entities) +import Text.Pandoc.XML (escapeStringForXML, fromEntities, toEntities) #if MIN_VERSION_blaze_markup(0,6,3) #else import Text.Blaze.Internal (preEscapedString, preEscapedText) @@ -207,10 +206,7 @@ writeHtmlString' :: PandocMonad m writeHtmlString' st opts d = do (body, context) <- evalStateT (pandocToHtml opts d) st (if writerPreferAscii opts - then - if stHtml5 st - then toHtml5Entities - else toEntities + then toEntities else id) <$> case writerTemplate opts of Nothing -> return $ renderHtml' body |