Skip to content

Commit a8ab144

Browse files
committed
fix wrong states
1 parent 13d24d4 commit a8ab144

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mode/markdown_highlight_rules.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ var MarkdownHighlightRules = function () {
237237
regex: /www\.[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*\.[a-zA-Z0-9-]+/
238238
}, { // autolink
239239
token: ["text", "url.underline", "text"],
240-
regex: /(<)?((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[^\s><]*))(>)?/
240+
regex: /(<)?((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[\w\/]+))(>)?/
241241
}, {include: "tag"}, {
242242
token: "comment",
243243
regex: /<!--/,
@@ -434,7 +434,12 @@ var MarkdownHighlightRules = function () {
434434
}, {include: "containerBlockInlinesList"}, codeBlockStartRule, {include: "basic"}, {
435435
token: "empty",
436436
regex: /(?=$)/,
437-
push: "lineStart"
437+
onMatch: function (value, scope, stack, line) {
438+
if (/^\s*$/.test(line)) {
439+
return scope.get("listBlockEmpty").get("lineStart").get("empty");
440+
}
441+
return this.token;
442+
}
438443
}, {defaultToken: "list"}
439444
],
440445
"lineStart": [

0 commit comments

Comments
 (0)