Skip to content

Commit 8b3d15a

Browse files
authored
(fix) syntax highlighting for self-closing (#779)
- Fix highlighting break when there's no space between `name` and `/` (#773 ) - `/` is now part of `...definition.tag.end.svelte`
1 parent 8abeb0f commit 8b3d15a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,21 +431,19 @@ repository:
431431
tags-start-attributes:
432432
begin: \G
433433
end: (?=/?>)
434-
endCaptures: { 0: { name: punctuation.definition.tag.end.svelte } }
435434
name: meta.tag.start.svelte
436435
patterns: [ include: '#attributes' ]
437436

438437
# Same as tags-start-attributes but slightly adjusted for special script/style/template tags.
439438
tags-lang-start-attributes:
440439
begin: \G
441440
end: (?=/>)|>
442-
endCaptures: { 0: { name: punctuation.definition.tag.end.svelte } }
443441
name: meta.tag.start.svelte
444442
patterns: [ include: '#attributes' ]
445443

446444
# Matches the beginning (`<name`) section of a tag start node.
447445
tags-start-node:
448-
match: (<)([^/\s>]*)
446+
match: (<)([^/\s>/]*)
449447
captures:
450448
1: { name: punctuation.definition.tag.begin.svelte }
451449
2: { patterns: [ include: '#tags-name' ] }
@@ -496,8 +494,8 @@ repository:
496494
# Split up into start and end because we don't need to preserve the name
497495
# inside and because it makes whitespace matching logic more robust
498496
tags-general-start:
499-
begin: (<)([^/\s>]*)
500-
end: (>)
497+
begin: (<)([^/\s>/]*)
498+
end: (/?>)
501499
beginCaptures: { 0: { patterns: [ include: '#tags-start-node' ] } }
502500
endCaptures:
503501
1: { name: meta.tag.start.svelte punctuation.definition.tag.end.svelte }

0 commit comments

Comments
 (0)