mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-23 19:49:17 +08:00
Update tokenization rules
This commit is contained in:
parent
6b49ad15cf
commit
2f3b67b48b
@ -8,8 +8,8 @@ export function srtDefinition() {
|
||||
block: [
|
||||
[/^\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}/, {
|
||||
cases: {
|
||||
'@eos': {token: 'tag', next: '@subtitle'},
|
||||
'@default': {token: 'tag', next: '@ignore'}
|
||||
'@eos': {token: 'type.identifier', next: '@subtitle'},
|
||||
'@default': {token: 'type.identifier', next: '@ignore'}
|
||||
}
|
||||
}],
|
||||
[/^$/, 'string', '@pop']
|
||||
@ -19,35 +19,11 @@ export function srtDefinition() {
|
||||
[/.+$/, '', '@subtitle']
|
||||
],
|
||||
|
||||
tags: [
|
||||
[/^$/, 'string', '@popall'],
|
||||
[/<b>/, 'string.bold', '@bold'],
|
||||
[/<i>/, 'string.emphasis', '@italic'],
|
||||
[/<u>/, 'string.underline', '@underline']
|
||||
],
|
||||
|
||||
subtitle: [
|
||||
{include: '@tags'},
|
||||
[/^$/, 'string', '@popall'],
|
||||
[/<\/?(?:[ibu]|font(?:\s+color="[^"]+"\s*)?)>/, 'tag'],
|
||||
[/./, 'string']
|
||||
],
|
||||
|
||||
bold: [
|
||||
[/<\/b>/, 'string.bold', '@pop'],
|
||||
{include: '@tags'},
|
||||
[/./, 'string.bold'],
|
||||
],
|
||||
|
||||
italic: [
|
||||
[/<\/i>/, 'string.emphasis', '@pop'],
|
||||
{include: '@tags'},
|
||||
[/./, 'string.emphasis'],
|
||||
],
|
||||
|
||||
underline: [
|
||||
[/<\/u>/, 'string.underline', '@pop'],
|
||||
{include: '@tags'},
|
||||
[/./, 'string.underline'],
|
||||
],
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
export const customTokenThemeRules = [
|
||||
{token: 'custom-negation.gitignore', foreground: 'c00ce0'},
|
||||
{token: 'string.bold', fontStyle: 'bold'},
|
||||
{token: 'string.emphasis', fontStyle: 'italic'},
|
||||
{token: 'string.underline', fontStyle: 'underline'}
|
||||
{token: 'custom-negation.gitignore', foreground: 'c00ce0'}
|
||||
];
|
Loading…
Reference in New Issue
Block a user