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. --- pandoc.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pandoc.hs') diff --git a/pandoc.hs b/pandoc.hs index 20278d2d0..61499ad69 100644 --- a/pandoc.hs +++ b/pandoc.hs @@ -105,6 +105,7 @@ data Opt = Opt , optSmart :: Bool -- ^ Use smart typography , optOldDashes :: Bool -- ^ Parse dashes like pandoc <=1.8.2.1 , optHtml5 :: Bool -- ^ Produce HTML5 in HTML + , optHtmlQTags :: Bool -- ^ Use tags in HTML , optHighlight :: Bool -- ^ Highlight source code , optHighlightStyle :: Style -- ^ Style to use for highlighted code , optChapters :: Bool -- ^ Use chapter for top-level sects @@ -159,6 +160,7 @@ defaultOpts = Opt , optSmart = False , optOldDashes = False , optHtml5 = False + , optHtmlQTags = False , optHighlight = True , optHighlightStyle = pygments , optChapters = False @@ -431,6 +433,12 @@ options = return opt { optHtml5 = True })) "" -- "Produce HTML5 in HTML output" + , Option "" ["html-q-tags"] + (NoArg + (\opt -> do + return opt { optHtmlQTags = True })) + "" -- "Use tags for quotes in HTML" + , Option "" ["ascii"] (NoArg (\opt -> return opt { optAscii = True })) @@ -816,6 +824,7 @@ main = do , optSmart = smart , optOldDashes = oldDashes , optHtml5 = html5 + , optHtmlQTags = htmlQTags , optHighlight = highlight , optHighlightStyle = highlightStyle , optChapters = chapters @@ -1009,6 +1018,7 @@ main = do writerSourceDirectory = sourceDir, writerUserDataDir = datadir, writerHtml5 = html5, + writerHtmlQTags = htmlQTags, writerChapters = chapters, writerListings = listings, writerBeamer = False, -- cgit v1.2.3