From eebed6bc48c2e1b8c2da2e5b198e0164f76c0ab5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 15 Jan 2013 18:50:36 -0800 Subject: Added `writerHtmlQTags` and `--html-q-tags` option. The previous default was to use `` tags in HTML5. But `` 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 `` tags. --- src/Text/Pandoc/Options.hs | 2 ++ src/Text/Pandoc/Writers/HTML.hs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ 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 -- cgit v1.2.3