Skip to content

Commit

Permalink
fix wrong states
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Apr 5, 2024
1 parent 13d24d4 commit a8ab144
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mode/markdown_highlight_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ var MarkdownHighlightRules = function () {
regex: /www\.[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*\.[a-zA-Z0-9-]+/
}, { // autolink
token: ["text", "url.underline", "text"],
regex: /(<)?((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[^\s><]*))(>)?/
regex: /(<)?((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[\w\/]+))(>)?/
}, {include: "tag"}, {
token: "comment",
regex: /<!--/,
Expand Down Expand Up @@ -434,7 +434,12 @@ var MarkdownHighlightRules = function () {
}, {include: "containerBlockInlinesList"}, codeBlockStartRule, {include: "basic"}, {
token: "empty",
regex: /(?=$)/,
push: "lineStart"
onMatch: function (value, scope, stack, line) {
if (/^\s*$/.test(line)) {
return scope.get("listBlockEmpty").get("lineStart").get("empty");
}
return this.token;
}
}, {defaultToken: "list"}
],
"lineStart": [
Expand Down

0 comments on commit a8ab144

Please sign in to comment.