aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 182a144b3..90887bfae 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -308,7 +308,15 @@ pSelfClosing f g = do
return open
pQ :: TagParser [Inline]
-pQ = pInlinesInTags "q" (Quoted DoubleQuote)
+pQ = do
+ quoteContext <- stateQuoteContext `fmap` getState
+ let quoteType = case quoteContext of
+ InDoubleQuote -> SingleQuote
+ _ -> DoubleQuote
+ let innerQuoteContext = if quoteType == SingleQuote
+ then InSingleQuote
+ else InDoubleQuote
+ withQuoteContext innerQuoteContext $ pInlinesInTags "q" (Quoted quoteType)
pEmph :: TagParser [Inline]
pEmph = pInlinesInTags "em" Emph <|> pInlinesInTags "i" Emph