fixed Color highlight in xml closing tag

This commit is contained in:
Rajeshwar Singh 2025-09-27 12:22:16 +00:00
parent 9242cdfd03
commit f0f14feb37
2 changed files with 21 additions and 6 deletions

View file

@ -301,6 +301,21 @@ testTokenization('xml', [
}
],
// End Tag with Newline Before Closing Bracket
[
{
line: '</test',
tokens: [
{ startIndex: 0, type: 'delimiter.xml' },
{ startIndex: 2, type: 'tag.xml' }
]
},
{
line: '>',
tokens: [{ startIndex: 0, type: 'delimiter.xml' }]
}
],
// Comments
[
{

View file

@ -54,12 +54,7 @@ export const language = <languages.IMonarchLanguage>{
[/(<)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'tag', next: '@tag' }]],
// Standard closing tag
[
/(<\/)(@qualifiedName)(\s*)(>)/,
[{ token: 'delimiter' }, { token: 'tag' }, '', { token: 'delimiter' }]
],
// Meta tags - instruction
[/(<\/)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'tag', next: '@closeTag' }]], // Meta tags - instruction
[/(<\?)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'metatag', next: '@tag' }]],
// Meta tags - declaration
@ -77,6 +72,11 @@ export const language = <languages.IMonarchLanguage>{
[/\]/, '']
],
closeTag: [
[/[ \t\r\n]+/, ''],
[/>/, { token: 'delimiter', next: '@pop' }]
],
tag: [
[/[ \t\r\n]+/, ''],
[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/, ['attribute.name', '', 'attribute.value']],