-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Pairs of plus signs are used to indicate an "Inline Passthrough" in asciidoc.
$ pandoc --version
pandoc 3.1.3
$ echo 'I use [Notedpad++](http://example.com/) to write C++' | pandoc -f markdown -t asciidoc
Current output:
I use http://example.com/[Notedpad++] to write C++
Correct output:
I use http://example.com/[Notedpad{plus}{plus}] to write C{plus}{plus}
Here is how asciidoc renders the current incorrect output:
Here is how it should look:
(renderings done with the editor at https://asciidoc.org/)
As far as I can tell the escaping needs to be done for Text and [inline] Code AST nodes. CodeBlock must not be escaped.
I tried to write a lua filter to do this:
function Str (str)
str.text = str.text:gsub('+', '{plus}')
return str
end
-- this is an inline code. Standalone code blocks don't need escaping
function Code (code)
code.text = code.text:gsub('+', '{plus}')
return code
end
However, pandoc [correctly] escapes the {
with a backslash so you get literal {plus}
in the output.