Open Vampire opened 5 months ago
hmm, I'm not really sure what to do here. Again, a testcase might help.
Again here, just copy my concrete example into the scenario
Scenario: Codespan with pass shorthand
Given the Markdown source
"""
`foo(...)`
"""
When it is converted to AsciiDoc
Then the result should match the AsciiDoc source
"""
`+foo(...)+`
"""
But this is just one of many cases.
I'd suggest to implement the same logic as kramdoc uses, as it is written by the maintainer of Asciidoctor who should know best when what should better be used.
That's why I linked you to the regex that is used and the additional logic around ^
.
So what you imho should do is to port that logic from kramdoc to this lib so that they behave the same.
https://github.com/asciidoctor/kramdown-asciidoc does not translate all code spans 1:1 but sometimes uses
`+the code here+`
or`pass:c[the code here]`
depending on the wrapped code.It does this depending on a regex and some
^
check: https://github.com/asciidoctor/kramdown-asciidoc/blob/main/lib/kramdown-asciidoc/converter.rb#L525.Maybe this would make sense here too.
Otherwise for example
when with ![image](https://github.com/markdown-asciidoc/markdown-to-asciidoc/assets/325196/94cf34b0-e9cc-4321-9f4d-25299740a812)
`foo(...)`
gets rendered as`+foo(...)+`
it would be rendered better and more consistent with Markdown as