asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
340 stars 97 forks source link

Section syntax highlighting stop working when adding extra space to a table separator (`|== `) #894

Closed ebousse closed 3 months ago

ebousse commented 3 months ago
  • What you're trying to do

I am trying to have syntax highlighting for this piece of asciidoc code in the editor:

= Title

== Subsection 1

== Subsection 2

[cols="1,1"]
|===
|First cell
|Second cell
|=== 

== Subsection 3

== Subsection 4

Notice that the table end separator is followed by an extraneous space character: |===.

If processing this code with asciidoctor version 2.0.23, the result looks good:

image

  • What happened

Syntax highlighting stops working after the table end separator explained above, as can be seen with == Subsection 3 and == Subsection 4 remaining in default color:

image

  • What you expected to happen

I expected == Subsection 3 and == Subsection 4 to be colored the same as == Subsection 1 and == Subsection 2.

We'll also need your system information (get it under "Help" -> "About" in VS Code). Share the installed extension version (Ctrl + Shift + X or Cmd + Shift + X on macOS).

Version: 1.92.0
Commit: b1c0a14de1414fcdaa400695b4db1c0799bc3124
Date: 2024-07-31T23:26:45.634Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Linux x64 6.9.12-200.fc40.x86_64
ggrossetie commented 3 months ago

Related to https://github.com/asciidoctor/asciidoctor-vscode/issues/686 but in this case we might be able to do a fix by updating the grammar.

If you want to take a look: master/syntaxes/Asciidoctor.json and more specifically:

https://github.com/asciidoctor/asciidoctor-vscode/blob/e017e77f47fbe97bb11872df2b127cce26f8d1de/syntaxes/Asciidoctor.json#L1973-L2009

ebousse commented 3 months ago

Related to #686 but in this case we might be able to do a fix by updating the grammar.

If you want to take a look: master/syntaxes/Asciidoctor.json and more specifically:

https://github.com/asciidoctor/asciidoctor-vscode/blob/e017e77f47fbe97bb11872df2b127cce26f8d1de/syntaxes/Asciidoctor.json#L1973-L2009

Indeed! Sent a PR with a fix proposal.