diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 38c9b3bf3..f360aeee1 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -457,8 +457,13 @@ inlineToAsciiDoc opts (Quoted qt lst) = do DoubleQuote | isAsciidoctor -> [Str "\"`"] ++ lst ++ [Str "`\""] | otherwise -> [Str "``"] ++ lst ++ [Str "''"] -inlineToAsciiDoc _ (Code _ str) = return $ - text "`+" <> text (escapeStringUsing (backslashEscapes "`") str) <> "+`" +inlineToAsciiDoc _ (Code _ str) = do + isAsciidoctor <- gets asciidoctorVariant + let contents = text (escapeStringUsing (backslashEscapes "`") str) + return $ + if isAsciidoctor + then text "`+" <> contents <> "+`" + else text "`" <> contents <> "`" inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str inlineToAsciiDoc _ (Math InlineMath str) = do isAsciidoctor <- gets asciidoctorVariant |