Open lobre opened 3 days ago
The rendering in kak's help mode is done by a handful of regex matches in doc-render in rc/tools/doc.kak
and it looks to me as if the contents of `code quotes` aren't excluded properly from processing for things like *bold* and _italic_. The region highlighters used for normal syntax highlighting would be able to express this nicely because they can recurse, but as far as I know, they don't support removing the `...`, *...* or _..._ wrappers as the same point as highlighting them.
I wonder if selections could be used in a cleverer way to solve this? Select all the `code quotes` and transform+highlight them. Then subtract those selections from the buffer before doing the transform+highlight for *bold* and _italic_? Something like that anyway!
Version of Kakoune
80fcfebca8c62ace6cf2af9487784486af07d2d5
Reproducer
From within Kakoune, open the execeval doc.
Then, scroll to the
-buffer
flag explanation.Outcome
The asciidoc syntax is not rendered correctly. We see that the star disappeared at the beginning of the second sentence, and there is more bold than desired.
Expectations
If I check the source code, here it is:
So it should render like below instead:
Additional information
I tried playing with the asciidoc playground there: https://asciidoc.org/#try
But I cannot find a way to have a star in a block quote, plus "name" rendered as bold at the end.
I have tried: