git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: use numeric character references with `--ascii`.
d792427John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+2−6
@@ -59,8 +59,7 @@ import Text.DocTemplates (Context(..))
59import Text.Pandoc.Walk
59import Text.Pandoc.Walk
60import Text.Pandoc.Writers.Math
60import Text.Pandoc.Writers.Math
61import Text.Pandoc.Writers.Shared
61import Text.Pandoc.Writers.Shared
62−import Text.Pandoc.XML (escapeStringForXML, fromEntities,
62+import Text.Pandoc.XML (escapeStringForXML, fromEntities, toEntities)
63− toEntities, toHtml5Entities)
64#if MIN_VERSION_blaze_markup(0,6,3)
63#if MIN_VERSION_blaze_markup(0,6,3)
65#else
64#else
66import Text.Blaze.Internal (preEscapedString, preEscapedText)
65import Text.Blaze.Internal (preEscapedString, preEscapedText)
@@ -207,10 +206,7 @@ writeHtmlString' :: PandocMonad m
207writeHtmlString' st opts d = do
206writeHtmlString' st opts d = do
208 (body, context) <- evalStateT (pandocToHtml opts d) st
207 (body, context) <- evalStateT (pandocToHtml opts d) st
209 (if writerPreferAscii opts
208 (if writerPreferAscii opts
210− then
211− if stHtml5 st
212− then toHtml5Entities
213− else toEntities
209+ then toEntities
214 else id) <$>
210 else id) <$>
215 case writerTemplate opts of
211 case writerTemplate opts of
216 Nothing -> return $ renderHtml' body
212 Nothing -> return $ renderHtml' body
test/command/ascii.md+1−1
@@ -2,7 +2,7 @@
2pandoc -t html --ascii
2pandoc -t html --ascii
3äéıå
3äéıå
4^D
4^D
5−<p>&auml;&eacute;&imath;&aring;</p>
5+<p>&#228;&#233;&#305;&#229;</p>
6```
6```
7
7
8```
8```