-
-
Notifications
You must be signed in to change notification settings - Fork 90
Description
This issue replicates the findings reported here: nuxt-content/vscode-mdc#52
Referencing the line here:
| "begin": "(?x)\n (^|\\G)(\\s*)\n (:{2,}) # component colons\n (?i:\n (\\w[\\w\\d-]+) # component name\n ( # folowing spaces or attributes\n \\s*\n | \\s*({[^{]*})\n )\n $\n )", |
I believe the expression for MDC component block matching should be updated to only require a single word character (rather than two) after the leading :{2,} pattern in order to account for native Prose* components such as ProseA and ProseP in MDC.
Note
Please verify with shikijs, @antfu, and @farnabaz for proper functionality and matching across repositories, and I believe they would also want to make the change here: https://github.com/nuxtlabs/vscode-mdc/blob/892432874be99282bbf5171eb0d015e9f23a8d09/syntaxes/mdc.tmLanguage.json#L141
Reproduction
Utilizing the syntax highlighter playground from the homepage of https://shiki.style, paste this content into the live editor:
<!-- ✅ Proper highlighting -->
::card
---
foo: "bar"
---
::
:card{ foo="bar" }
<!-- ⚠️ Incorrect highlighting (only for block components) -->
::a
---
href: "https://example.com"
---
::
<!-- ✅ Proper highlighting (only for inline components) -->
:a{ href="https://example.com" }