diff options
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 472fb6a91..47738e69d 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -425,10 +425,16 @@ inlineToAsciiDoc opts (Subscript lst) = do contents <- inlineListToAsciiDoc opts lst return $ "~" <> contents <> "~" inlineToAsciiDoc opts (SmallCaps lst) = inlineListToAsciiDoc opts lst -inlineToAsciiDoc opts (Quoted SingleQuote lst) = - inlineListToAsciiDoc opts (Str "`" : lst ++ [Str "'"]) -inlineToAsciiDoc opts (Quoted DoubleQuote lst) = - inlineListToAsciiDoc opts (Str "``" : lst ++ [Str "''"]) +inlineToAsciiDoc opts (Quoted qt lst) = do + isAsciidoctor <- gets asciidoctorVariant + inlineListToAsciiDoc opts $ + case qt of + SingleQuote + | isAsciidoctor -> [Str "'`"] ++ lst ++ [Str "`'"] + | otherwise -> [Str "`"] ++ lst ++ [Str "'"] + DoubleQuote + | isAsciidoctor -> [Str "\"`"] ++ lst ++ [Str "`\""] + | otherwise -> [Str "``"] ++ lst ++ [Str "''"] inlineToAsciiDoc _ (Code _ str) = return $ text "`" <> text (escapeStringUsing (backslashEscapes "`") str) <> "`" inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str |