diff --git a/platform/mv3/extension/js/develop.js b/platform/mv3/extension/js/develop.js index 5d70aac98..517647d1b 100644 --- a/platform/mv3/extension/js/develop.js +++ b/platform/mv3/extension/js/develop.js @@ -484,7 +484,7 @@ class Editor { } gutterClick(view, info) { - const reSeparator = /^---\s*/; + const reSeparator = /^(?:---|# ---)\s*/; const { doc } = view.state; const lineFirst = doc.lineAt(info.from); if ( lineFirst.text === '' ) { return false; } @@ -547,6 +547,11 @@ class Editor { return { scope: 0 }; }, 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'; } + } const c = stream.peek(); if ( c === '#' ) { if ( (stream.pos === 0 || /\s/.test(stream.string.charAt(stream.pos - 1))) ) { @@ -554,10 +559,6 @@ class Editor { return 'comment'; } } - if ( stream.sol() ) { - if ( stream.match(/---\s*$/) ) { return 'meta'; } - if ( stream.match(/\.\.\.\s*$/) ) { return 'meta'; } - } if ( stream.eatSpace() ) { return null; }