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

Verse delimited block syntax breaks syntax highlighting. #893

Open
Tracked by #686
dgrahn opened this issue Jul 30, 2024 · 1 comment
Open
Tracked by #686

Verse delimited block syntax breaks syntax highlighting. #893

dgrahn opened this issue Jul 30, 2024 · 1 comment

Comments

@dgrahn
Copy link

dgrahn commented Jul 30, 2024

Problem

I'm trying to write a verse with the delimited block syntax. However, this breaks syntax highlight for all content beneath the block. Problem shown below, reproduce by copying provided AsciiDoc into a new file. It breaks without the sidebar code too.

image

Copyable AsciiDoc
= Hello

****
[verse,The Agile Manifesto]
----
We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on
the right, we value the items on the left more.
----
****

= Hello

Versions

AsciiDoc: v3.3.1
Version: 1.91.1 (user setup)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:06:49.809Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

I didn't see any logs related to AsciiDoc.

@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: https://github.com/asciidoctor/asciidoctor-vscode/blob/master/syntaxes/Asciidoctor.json and more specifically:

"quote-paragraph": {
"patterns": [
{
"name": "markup.italic.quotes.asciidoc",
"begin": "(?=(?>(?:^\\[(quote|verse)((?:,|#|\\.|%)([^,\\]]+))*\\]$)))",
"patterns": [
{
"match": "^\\[(quote|verse)((?:,|#|\\.|%)([^,\\]]+))*\\]$",
"captures": {
"0": {
"patterns": [
{
"include": "#block-attribute-inner"
}
]
}
}
},
{
"include": "#block-title"
},
{
"include": "#inlines"
},
{
"comment": "quotes block",
"begin": "^([_]{4,})\\s*$",
"patterns": [
{
"include": "#inlines"
},
{
"include": "#list"
}
],
"end": "(?<=\\1)"
},
{
"comment": "air quotes",
"begin": "^(\"{2})\\s*$",
"patterns": [
{
"include": "#inlines"
},
{
"include": "#list"
}
],
"end": "(?<=\\1)"
},
{
"comment": "open block",
"begin": "^(-{2})\\s*$",
"patterns": [
{
"include": "#inlines"
},
{
"include": "#list"
}
],
"end": "(?<=\\1)$"
}
],
"end": "((?<=____|\"\"|--)$|^\\p{Blank}*$)"
},
{
"name": "markup.italic.quotes.asciidoc",
"begin": "^(\"\")$",
"patterns": [
{
"include": "#inlines"
},
{
"include": "#list"
}
],
"end": "^\\1$"
},
{
"name": "markup.italic.quotes.asciidoc",
"begin": "^\\p{Blank}*(>) ",
"patterns": [
{
"include": "#inlines"
},
{
"include": "#list"
}
],
"end": "^\\p{Blank}*?$"
}
]
},

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

No branches or pull requests

2 participants