Some code spans should be transformed with a pass macro or shorthand, depending on content
Vampire opened this issue · 2 comments
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 `foo(...)`
gets rendered as
when with `+foo(...)+`
it would be rendered better and more consistent with Markdown as
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.