mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Merge pull request #14 from AndersMad/master
HTML Tags: Add support for dash and fix colon in end tag
This commit is contained in:
commit
37e390f5ae
2 changed files with 17 additions and 3 deletions
|
|
@ -76,11 +76,11 @@ export var language = <ILanguage> {
|
|||
root: [
|
||||
[/<!DOCTYPE/, 'metatag', '@doctype'],
|
||||
[/<!--/, 'comment', '@comment'],
|
||||
[/(<)(\w+)(\/>)/, [htmlTokenTypes.DELIM_START, 'tag', htmlTokenTypes.DELIM_END]],
|
||||
[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/, [htmlTokenTypes.DELIM_START, 'tag', '', htmlTokenTypes.DELIM_END]],
|
||||
[/(<)(script)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@script'} ]],
|
||||
[/(<)(style)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@style'} ]],
|
||||
[/(<)([:\w]+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag'} ]],
|
||||
[/(<\/)(\w+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag' }]],
|
||||
[/(<)((?:[\w\-]+:)?[\w\-]+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag' }]],
|
||||
[/(<\/)((?:[\w\-]+:)?[\w\-]+)/, [htmlTokenTypes.DELIM_START, { token: 'tag', next: '@otherTag' }]],
|
||||
[/</, htmlTokenTypes.DELIM_START],
|
||||
[/[^<]+/], // text
|
||||
],
|
||||
|
|
|
|||
|
|
@ -599,5 +599,19 @@ testTokenization(['html', 'css'], [
|
|||
{ startIndex:0, type: DOCTYPE },
|
||||
{ startIndex:11, type: DELIM_DOCTYPE }
|
||||
]
|
||||
}],
|
||||
|
||||
// PR #14
|
||||
[{
|
||||
line: '<asdf:bar>asd</asdf:bar>',
|
||||
tokens: [
|
||||
{ startIndex:0, type: DELIM_START },
|
||||
{ startIndex:1, type: getTag('asdf:bar') },
|
||||
{ startIndex:9, type: DELIM_END },
|
||||
{ startIndex:10, type: '' },
|
||||
{ startIndex:13, type: DELIM_START },
|
||||
{ startIndex:15, type: getTag('asdf:bar') },
|
||||
{ startIndex:23, type: DELIM_END }
|
||||
]
|
||||
}]
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue