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.
This commit is contained in:
parent
5e708eb8ce
commit
d79242796b
2 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
pandoc -t html --ascii
|
||||
äéıå
|
||||
^D
|
||||
<p>äéıå</p>
|
||||
<p>äéıå</p>
|
||||
```
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue