mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Use custom tokens for YAML document boundaries
This commit is contained in:
parent
8bcf533fc0
commit
d9aba4acca
3 changed files with 8 additions and 6 deletions
|
|
@ -31,8 +31,7 @@ section[data-pane="develop"] > div > * {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
#cm-container .cm-editor .cm-line:has(.ͼ5),
|
||||
#cm-container .cm-editor .cm-line:has(.ͼw) {
|
||||
#cm-container .cm-editor .cm-line:has(.yamlboundary) {
|
||||
background-image: url('line-hor-dashed.png'), url('line-hor-dashed.png');
|
||||
background-position: left 3px, left calc(100% - 3px);
|
||||
background-repeat: repeat-x;
|
||||
|
|
|
|||
|
|
@ -557,9 +557,9 @@ class Editor {
|
|||
},
|
||||
token: (stream, state) => {
|
||||
if ( stream.sol() ) {
|
||||
if ( stream.match(/^---\s*$/) ) { return 'meta'; }
|
||||
if ( stream.match(/^# ---\s*$/) ) { return 'meta comment'; }
|
||||
if ( stream.match(/\.\.\.\s*$/) ) { return 'meta'; }
|
||||
if ( stream.match(/^---\s*$/) ) { return 'yamlboundary'; }
|
||||
if ( stream.match(/^# ---\s*$/) ) { return 'yamlboundary comment'; }
|
||||
if ( stream.match(/\.\.\.\s*$/) ) { return 'yamlboundary'; }
|
||||
}
|
||||
const c = stream.peek();
|
||||
if ( c === '#' ) {
|
||||
|
|
@ -597,6 +597,9 @@ class Editor {
|
|||
languageData: {
|
||||
commentTokens: { line: '#' },
|
||||
},
|
||||
tokenTable: [
|
||||
'yamlboundary',
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4352f572758bc43ebabddb67b98875e8fde7c297
|
||||
Subproject commit 4bacc0ca79f3eb4c6e395bf54d3f5efe4da4e07c
|
||||
Loading…
Reference in a new issue