Repository navigation
Vue Issues #43
Description
raw-style-less-inline is not needed as raw-style-less-inline-ml can cover the exact same code and more
Lines 2201 to 2239 in 70a8019
| "raw-style-less-inline": { | |
| "name": "meta.style.vue", | |
| "match": "(<)([Ss][Tt][Yy][Ll][Ee])\\b([^>]*\\blang\\s*=\\s*[\"']less[\"'][^>]*)(>)(.*?)(</)([Ss][Tt][Yy][Ll][Ee])\\s*(>)", | |
| "captures": { | |
| "1": { | |
| "name": "punctuation.definition.tag.begin.vue" | |
| }, | |
| "2": { | |
| "name": "entity.name.tag.vue" | |
| }, | |
| "3": { | |
| "patterns": [ | |
| { | |
| "include": "#attribute" | |
| } | |
| ] | |
| }, | |
| "4": { | |
| "name": "punctuation.definition.tag.end.vue" | |
| }, | |
| "5": { | |
| "name": "source.css.less", | |
| "patterns": [ | |
| { | |
| "include": "source.css.less" | |
| } | |
| ] | |
| }, | |
| "6": { | |
| "name": "punctuation.definition.tag.begin.vue" | |
| }, | |
| "7": { | |
| "name": "entity.name.tag.vue" | |
| }, | |
| "8": { | |
| "name": "punctuation.definition.tag.end.vue" | |
| } | |
| } | |
| }, |
raw-style-less-close will never match
since raw-style-scss-close is the exact same regex and is matched first
raw-style-less and raw-style-less-close need to be combined into a single (nested) rule to work correctly
Lines 2282 to 2333 in 70a8019
| "raw-style-less": { | |
| "name": "meta.style.vue", | |
| "begin": "(<)([Ss][Tt][Yy][Ll][Ee])\\b([^>]*\\blang\\s*=\\s*[\"']less[\"'][^>]*)(>)", | |
| "beginCaptures": { | |
| "1": { | |
| "name": "punctuation.definition.tag.begin.vue" | |
| }, | |
| "2": { | |
| "name": "entity.name.tag.vue" | |
| }, | |
| "3": { | |
| "patterns": [ | |
| { | |
| "include": "#attribute" | |
| } | |
| ] | |
| }, | |
| "4": { | |
| "name": "punctuation.definition.tag.end.vue" | |
| } | |
| }, | |
| "while": "^(?!.*</[Ss][Tt][Yy][Ll][Ee](?:[\\s>]|$))", | |
| "contentName": "source.css.less", | |
| "patterns": [ | |
| { | |
| "include": "source.css.less" | |
| } | |
| ] | |
| }, | |
| "raw-style-less-close": { | |
| "name": "meta.style.vue", | |
| "match": "^(\\s*)((?:(?!<[Ss][Tt][Yy][Ll][Ee]\\b).)+?)(</)([Ss][Tt][Yy][Ll][Ee])\\s*(>)", | |
| "captures": { | |
| "2": { | |
| "name": "source.css.less", | |
| "patterns": [ | |
| { | |
| "include": "source.css.less" | |
| } | |
| ] | |
| }, | |
| "3": { | |
| "name": "punctuation.definition.tag.begin.vue" | |
| }, | |
| "4": { | |
| "name": "entity.name.tag.vue" | |
| }, | |
| "5": { | |
| "name": "punctuation.definition.tag.end.vue" | |
| } | |
| } | |
| }, |
raw-style-less-close is not needed as raw-style-less-close-ml can cover the exact same code and more
[Ss][Tt][Yy][Ll][Ee] can be replaced with (?i:style)
I remember seeing one of your commits say why you chose this decision
tho I don't remember the reason
[\"']less[\"'] matches the incorrect string "less' and 'less"
all issues are present in all raw embedded languages
Activity
vue(highlight): emit the raw-embed close rule once, lang-independent (#…
vue(comment): correct the caseFoldLiteral rationale — (?i:) Unicode o…
johnsoncodehk commentedon Jun 15, 2026
On the
[Ss][Tt][Yy][Ll][Ee]→(?i:style)suggestion — keeping the per-character class is deliberate, and it's a correctness choice (the old code comment that framed it as byte-thrift was wrong; fixed).(?i:)in (vscode-)oniguruma applies full Unicode case-folding, so it over-matches non-ASCII case-equivalents:(?i:style)matchesſtyle— U+017F LATIN SMALL LETTER LONG S folds tos(?i:k)matches U+212A KELVIN SIGN, etc.HTML tag-name matching is ASCII-case-insensitive only (the spec ASCII-lowercases names, and our lexer folds via
.toLowerCase(), which leavesſunchanged). So(?i:style)would treat<ſtyle>as astyleelement and embed CSS, whereas[Ss][Tt][Yy][Ll][Ee]matches exactly the ASCII set the lexer folds — keeping the highlighter consistent with the parser by construction. That's why it stays.Everything else in this issue is fixed (#48): the duplicate/shadowed raw-embed close rules are deduped to one lang-independent rule, the back-referenced
langquote already rejects"less', and the-inline/-closepairs are complementary (>-on-line vs deferred->) rather than redundant.