Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #686
ebousse opened this issue Aug 6, 2024 · 2 comments · Fixed by #895
Closed
Tracked by #686
Labels

Comments

@ebousse
Copy link
Contributor

ebousse commented Aug 6, 2024

  • 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
Copy link
Member

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:

"table-psv": {
"patterns": [
{
"name": "markup.table.asciidoc",
"begin": "^(\\|===)$",
"beginCaptures": {
"0": {
"name": "markup.table.delimiter.asciidoc"
}
},
"contentName": "markup.table.content.asciidoc",
"patterns": [
{
"comment": "cell separator and attributes",
"match": "(^|[^\\p{Blank}\\\\]*)(?<!\\\\)(\\|)",
"captures": {
"1": {
"name": "markup.meta.attribute-list.asciidoc"
},
"2": {
"name": "markup.table.cell.delimiter.asciidoc"
}
}
},
{
"include": "#tables-includes"
}
],
"end": "^(\\1)$",
"endCaptures": {
"0": {
"name": "markup.table.delimiter.asciidoc"
}
}
}
]
},

@ebousse
Copy link
Contributor Author

ebousse commented Aug 6, 2024

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:

"table-psv": {
"patterns": [
{
"name": "markup.table.asciidoc",
"begin": "^(\\|===)$",
"beginCaptures": {
"0": {
"name": "markup.table.delimiter.asciidoc"
}
},
"contentName": "markup.table.content.asciidoc",
"patterns": [
{
"comment": "cell separator and attributes",
"match": "(^|[^\\p{Blank}\\\\]*)(?<!\\\\)(\\|)",
"captures": {
"1": {
"name": "markup.meta.attribute-list.asciidoc"
},
"2": {
"name": "markup.table.cell.delimiter.asciidoc"
}
}
},
{
"include": "#tables-includes"
}
],
"end": "^(\\1)$",
"endCaptures": {
"0": {
"name": "markup.table.delimiter.asciidoc"
}
}
}
]
},

Indeed! Sent a PR with a fix proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants