git.iko.soy/typeable/pandoc
on master help sign in
Asciidoc writer: use `` `+...+` `` form for inline code.

The old `` `a__b__c` `` yields emphasis inside code in asciidoc. To get a pure literal code span, use `` `+a__b__c+` ``.

commit98ee6ca289ad7117b7336a57bcfc6f4b54463f4e authorJohn MacFarlane <jgm@berkeley.edu> dateSun 5 May 2019, 21:57 (7 years ago) parent5affa30
3 files changed+14−14
src/Text/Pandoc/Writers/AsciiDoc.hs+1−1 test/writer.asciidoc+6−6 test/writer.asciidoctor+7−7
src/Text/Pandoc/Writers/AsciiDoc.hs+1−1
@@ -436,7 +436,7 @@ inlineToAsciiDoc opts (Quoted qt lst) = do
436436 | isAsciidoctor -> [Str "\"`"] ++ lst ++ [Str "`\""]
437437 | otherwise -> [Str "``"] ++ lst ++ [Str "''"]
438438inlineToAsciiDoc _ (Code _ str) = return $
439− text "`" <> text (escapeStringUsing (backslashEscapes "`") str) <> "`"
439+ text "`+" <> text (escapeStringUsing (backslashEscapes "`") str) <> "+`"
440440inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str
441441inlineToAsciiDoc _ (Math InlineMath str) = do
442442 isAsciidoctor <- gets asciidoctorVariant
test/writer.asciidoc+6−6
@@ -423,7 +423,7 @@ So is *_this_* word.
423423
424424So is *_this_* word.
425425
426−This is code: `>`, `$`, `\`, `\$`, `<html>`.
426+This is code: `+>+`, `+$+`, `+\+`, `+\$+`, `+<html>+`.
427427
428428[line-through]*This is _strikeout_.*
429429
@@ -446,7 +446,7 @@ spaces: a^b c^d, a~b c~d.
446446
447447`He said, ``I want to go.''' Were you alive in the 70’s?
448448
449−Here is some quoted ``code`' and a ``http://example.com/?foo=1&bar=2[quoted
449+Here is some quoted ``+code+`' and a ``http://example.com/?foo=1&bar=2[quoted
450450link]''.
451451
452452Some dashes: one—two — three—four — five.
@@ -476,11 +476,11 @@ latexmath:[$\alpha + \omega \times x^2$].
476476
477477These shouldn’t be math:
478478
479−* To get the famous equation, write `$e = mc^2$`.
479+* To get the famous equation, write `+$e = mc^2$+`.
480480* $22,000 is a _lot_ of money. So is $34,000. (It worked if ``lot'' is
481481emphasized.)
482482* Shoes ($20) and socks ($5).
483−* Escaped `$`: $73 _this should be emphasized_ 23$.
483+* Escaped `+$+`: $73 _this should be emphasized_ 23$.
484484
485485Here’s a LaTeX table:
486486
@@ -610,7 +610,7 @@ ____
610610Blockquoted: http://example.com/
611611____
612612
613−Auto-links should not occur here: `<http://example.com/>`
613+Auto-links should not occur here: `+<http://example.com/>+`
614614
615615....
616616or here: <http://example.com/>
@@ -635,7 +635,7 @@ anywhere after the footnote reference. It need not be placed at the end of the
635635document.] and another.[multiblock footnote omitted] This should _not_ be a
636636footnote reference, because it contains a space.[^my note] Here is an inline
637637note.footnote:[This is _easier_ to type. Inline notes may contain
638−http://google.com[links] and `]` verbatim characters, as well as [bracketed
638+http://google.com[links] and `+]+` verbatim characters, as well as [bracketed
639639text].]
640640
641641____
test/writer.asciidoctor+7−7
@@ -424,7 +424,7 @@ So is *_this_* word.
424424
425425So is *_this_* word.
426426
427−This is code: `>`, `$`, `\`, `\$`, `<html>`.
427+This is code: `+>+`, `+$+`, `+\+`, `+\$+`, `+<html>+`.
428428
429429[line-through]*This is _strikeout_.*
430430
@@ -447,8 +447,8 @@ spaces: a^b c^d, a~b c~d.
447447
448448'`He said, "`I want to go.`"`' Were you alive in the 70’s?
449449
450−Here is some quoted '``code``' and a "`http://example.com/?foo=1&bar=2[quoted
451−link]`".
450+Here is some quoted '``+code+``' and a
451+"`http://example.com/?foo=1&bar=2[quoted link]`".
452452
453453Some dashes: one—two — three—four — five.
454454
@@ -477,11 +477,11 @@ latexmath:[\alpha + \omega \times x^2].
477477
478478These shouldn’t be math:
479479
480−* To get the famous equation, write `$e = mc^2$`.
480+* To get the famous equation, write `+$e = mc^2$+`.
481481* $22,000 is a _lot_ of money. So is $34,000. (It worked if "`lot`" is
482482emphasized.)
483483* Shoes ($20) and socks ($5).
484−* Escaped `$`: $73 _this should be emphasized_ 23$.
484+* Escaped `+$+`: $73 _this should be emphasized_ 23$.
485485
486486Here’s a LaTeX table:
487487
@@ -611,7 +611,7 @@ ____
611611Blockquoted: http://example.com/
612612____
613613
614−Auto-links should not occur here: `<http://example.com/>`
614+Auto-links should not occur here: `+<http://example.com/>+`
615615
616616....
617617or here: <http://example.com/>
@@ -636,7 +636,7 @@ anywhere after the footnote reference. It need not be placed at the end of the
636636document.] and another.[multiblock footnote omitted] This should _not_ be a
637637footnote reference, because it contains a space.[^my note] Here is an inline
638638note.footnote:[This is _easier_ to type. Inline notes may contain
639−http://google.com[links] and `]` verbatim characters, as well as [bracketed
639+http://google.com[links] and `+]+` verbatim characters, as well as [bracketed
640640text].]
641641
642642____