summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-01-15 18:50:36 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-01-15 18:50:36 -0800
commiteebed6bc48c2e1b8c2da2e5b198e0164f76c0ab5 (patch)
tree4117fce2210b2fe9e10d2413d0d6177946356248 /src
parent93b373d4eb39c0ec13a563ee48ec2e0c9adf63a2 (diff)
Added `writerHtmlQTags` and `--html-q-tags` option.
The previous default was to use `<q>` tags in HTML5. But `<q>` tags are also valid HTML4, and they are not very robust in HTML5. Some user agents don't support them, and some CSS resets prevent pandoc's quotes CSS from working properly (e.g. bootstrap). It seems a better default just to insert quote characters, but the option is provided for those who have gotten used to using `<q>` tags.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Options.hs2
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index 0471161e0..c659b652d 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -262,6 +262,7 @@ data WriterOptions = WriterOptions
, writerCiteMethod :: CiteMethod -- ^ How to print cites
, writerBiblioFiles :: [FilePath] -- ^ Biblio files to use for citations
, writerHtml5 :: Bool -- ^ Produce HTML5
+ , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML
, writerBeamer :: Bool -- ^ Produce beamer LaTeX slide show
, writerSlideLevel :: Maybe Int -- ^ Force header level of slides
, writerChapters :: Bool -- ^ Use "chapter" for top-level sects
@@ -303,6 +304,7 @@ instance Default WriterOptions where
, writerCiteMethod = Citeproc
, writerBiblioFiles = []
, writerHtml5 = False
+ , writerHtmlQTags = False
, writerBeamer = False
, writerSlideLevel = Nothing
, writerChapters = False
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 3b9a1eae6..3111cbecb 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -618,7 +618,7 @@ inlineToHtml opts inline =
strToHtml "’")
DoubleQuote -> (strToHtml "“",
strToHtml "”")
- in if writerHtml5 opts
+ in if writerHtmlQTags opts
then do
modify $ \st -> st{ stQuotes = True }
H.q `fmap` inlineListToHtml opts lst