Make --ascii work with DocBook output too.

This commit is contained in:
John MacFarlane 2017-02-25 13:34:46 +01:00
parent 7d0082aa0b
commit 3a1a50a45f
2 changed files with 6 additions and 3 deletions

View file

@ -646,8 +646,8 @@ Options affecting specific writers
`--ascii` `--ascii`
: Use only ASCII characters in output. Currently supported only : Use only ASCII characters in output. Currently supported only for
for HTML output (which uses numerical entities instead of HTML and DocBook output (which uses numerical entities instead of
UTF-8 when this option is selected). UTF-8 when this option is selected).
`--reference-links` `--reference-links`

View file

@ -411,7 +411,10 @@ convertWithOpts opts = do
selfcontain = if optSelfContained opts && htmlFormat selfcontain = if optSelfContained opts && htmlFormat
then makeSelfContained writerOptions then makeSelfContained writerOptions
else return else return
handleEntities = if htmlFormat && optAscii opts handleEntities = if (htmlFormat ||
format == "docbook4" ||
format == "docbook5" ||
format == "docbook") && optAscii opts
then toEntities then toEntities
else id else id
output <- f writerOptions doc' output <- f writerOptions doc'