Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #150 from lofcz/main
Browse files Browse the repository at this point in the history
Fix razor + liquid render of tags with a dash symbol
  • Loading branch information
hediet committed Jul 22, 2021
2 parents 52597f7 + d3e1f45 commit c60db94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/liquid/liquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/razor/razor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit c60db94

Please sign in to comment.