Fix razor + liquid render of tags with a dash symbol

pull/2748/head
lofcz 2021-07-22 21:18:54 +02:00
parent 8edbbc5a7b
commit d3e1f45a4e
2 changed files with 8 additions and 8 deletions

View File

@ -167,9 +167,9 @@ export const language = <languages.IMonarchLanguage>{
[/\{\%\s*comment\s*\%\}/, 'comment.start.liquid', '@comment'],
[/\{\{/, { token: '@rematch', switchTo: '@liquidState.root' }],
[/\{\%/, { token: '@rematch', switchTo: '@liquidState.root' }],
[/(<)(\w+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)([\w\-]+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/(<\/)([\w\-]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/</, 'delimiter.html'],
[/\{/, 'delimiter.html'],
[/[^<{]+/] // text

View File

@ -85,11 +85,11 @@ export const language = <languages.IMonarchLanguage>{
[/@[^@]/, { token: '@rematch', switchTo: '@razorInSimpleState.root' }],
[/<!DOCTYPE/, 'metatag.html', '@doctype'],
[/<!--/, 'comment.html', '@comment'],
[/(<)(\w+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)([\w\-]+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]],
[/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]],
[/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/(<)([:\w\-]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/(<\/)([\w\-]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]],
[/</, 'delimiter.html'],
[/[ \t\r\n]+/], // whitespace
[/[^<@]+/] // text
@ -453,9 +453,9 @@ export const language = <languages.IMonarchLanguage>{
[/'([^']*)'/, 'string.cs'],
// simple html
[/(<)(\w+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)(\w+)(>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<\/)(\w+)(>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)([\w\-]+)(\/>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<)([\w\-]+)(>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
[/(<\/)([\w\-]+)(>)/, ['delimiter.html', 'tag.html', 'delimiter.html']],
// delimiters
[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/, 'delimiter.cs'],