diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-02-25 13:34:46 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-02-25 13:35:34 +0100 |
commit | 3a1a50a45fb4e2fe2f4f03297e2428ec51059ea9 (patch) | |
tree | 6605757c55f6123e34151cbf95d618bb0bb9e31d | |
parent | 7d0082aa0b631592f38fc9436a3d0dd5426653cf (diff) | |
download | pandoc-3a1a50a45fb4e2fe2f4f03297e2428ec51059ea9.tar.gz |
Make `--ascii` work with DocBook output too.
-rw-r--r-- | MANUAL.txt | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/App.hs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/MANUAL.txt b/MANUAL.txt index 81e3ad663..2f1fa30af 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -646,8 +646,8 @@ Options affecting specific writers `--ascii` -: Use only ASCII characters in output. Currently supported only - for HTML output (which uses numerical entities instead of +: Use only ASCII characters in output. Currently supported only for + HTML and DocBook output (which uses numerical entities instead of UTF-8 when this option is selected). `--reference-links` diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index e84e5a136..1a41050d7 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -411,7 +411,10 @@ convertWithOpts opts = do selfcontain = if optSelfContained opts && htmlFormat then makeSelfContained writerOptions else return - handleEntities = if htmlFormat && optAscii opts + handleEntities = if (htmlFormat || + format == "docbook4" || + format == "docbook5" || + format == "docbook") && optAscii opts then toEntities else id output <- f writerOptions doc' |