tajmone / ST4-Asciidoctor

AsciiDoc Package for SublimeText 4
https://tajmone.github.io/ST4-Asciidoctor
MIT License
11 stars 6 forks source link

Problem with starting code markers that follow directly after a bracket #4

Closed SicroAtGit closed 3 years ago

SicroAtGit commented 3 years ago

I have an AsciiDoc file that contains a code enclosed in code markers (`). Directly before the starting code marker there is a bracket which causes your AsciiDoc package to mark it as an error:

error

SicroAtGit commented 3 years ago

I just noticed that AsciiDoctor also has problems with this and also does not interpret the starting code marker as such. Then everything is correct and this issue can be closed. But it is still good to have mentioned it here, I think.

tajmone commented 3 years ago

The idea of marking the error with a red line is based on the assumption that inline quotes should be on a same line (i.e. not wrapping text in the middle of quote markup), which makes sense since idiomatic AsciiDoc should be wrapped one-sentence-per-line.

But the problem here is that you should be using unconstrained quotes, due to the special * char:

{nbsp}``*``

which is then parsed correctly by the syntax.

Defintely, in the future the syntax should be able to handle better some edge cases and errors, but right now it's too early for some of these, because it's already entangled enough, and too many syntax elements are still either suppressed or not implemented.

The switch from the original ST2 syntax to the new ST3 format is not all that easy, because the new format allows more powerful handling of states, so each element should be basically re-written almost from scratch (although we can salvage most of the original RegExs definitions and scopes namings).

tajmone commented 3 years ago

P.S. don't forget that AsciiDoc allows quote markup inside line-code, so unless you use the double ticks (unconstrained) AsciiDoc will assume that the * is for marking contents as strong.

See:

SicroAtGit commented 3 years ago

Okay, thanks. I will use the double ticks.