@@ -59,12 +59,14 @@ import Data.Monoid (mempty, mconcat)
5959data WriterState = WriterState
6060 { stNotes :: [Html] -- ^ List of notes
6161 , stMath :: Bool -- ^ Math is used in document
62+ , stQuotes :: Bool -- ^ <q> tag is used
6263 , stHighlighting :: Bool -- ^ Syntax highlighting is used
6364 , stSecNum :: [Int] -- ^ Number of current section
6465 }
6566
6667defaultWriterState :: WriterState
67−defaultWriterState = WriterState {stNotes= [], stMath = False, stHighlighting = False, stSecNum = []}
68+defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False,
69+ stHighlighting = False, stSecNum = []}
6870
6971-- Helpers to render HTML with the appropriate function.
7072
@@ -156,7 +158,8 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
156158 let newvars = [("highlighting-css",
157159 styleToCss $ writerHighlightStyle opts) |
158160 stHighlighting st] ++
159− [("math", renderHtml math) | stMath st]
161+ [("math", renderHtml math) | stMath st] ++
162+ [("quotes", "yes") | stQuotes st]
160163 return (tit, auths, authsMeta, date, toc, thebody, newvars)
161164
162165-- | Prepare author for meta tag, converting notes into
@@ -581,8 +584,12 @@ inlineToHtml opts inline =
581584 strToHtml "’")
582585 DoubleQuote -> (strToHtml "“",
583586 strToHtml "”")
584− in do contents <- inlineListToHtml opts lst
585− return $ leftQuote >> contents >> rightQuote
587+ in if writerHtml5 opts
588+ then do
589+ modify $ \st -> st{ stQuotes = True }
590+ H.q `fmap` inlineListToHtml opts lst
591+ else (\x -> leftQuote >> x >> rightQuote)
592+ `fmap` inlineListToHtml opts lst
586593 (Math t str) -> modify (\st -> st {stMath = True}) >>
587594 (case writerHTMLMathMethod opts of
588595 LaTeXMathML _ ->