Fixed url highlighting in editor
This commit is contained in:
parent
a5719f45de
commit
bef54c64b8
@ -1,9 +1,9 @@
|
||||
// Credit to https://editorially.com/
|
||||
Prism.languages.md = (function () {
|
||||
Prism.languages.md = (function() {
|
||||
|
||||
var charInsideUrl = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",
|
||||
charEndingUrl = "[-A-Z0-9+&@#/%=~_|[\\])]";
|
||||
var urlPattern = new RegExp("(=\"|<)?\\b(https?|ftp)(://" + charInsideUrl + "*" + charEndingUrl + ")(?=$|\\W)", "gi");
|
||||
var urlPattern = new RegExp("(https?|ftp)(://" + charInsideUrl + "*" + charEndingUrl + ")(?=$|\\W)", "gi");
|
||||
var emailPattern = /(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)/gi;
|
||||
|
||||
var latex = Prism.languages.latex;
|
||||
@ -28,7 +28,7 @@ Prism.languages.md = (function () {
|
||||
inside: {
|
||||
}
|
||||
};
|
||||
for (var i = 6; i >= 1; i--) {
|
||||
for(var i = 6; i >= 1; i--) {
|
||||
md["h" + i] = {
|
||||
pattern: new RegExp("^#{" + i + "}.+$", "gm"),
|
||||
inside: {
|
||||
@ -40,7 +40,13 @@ Prism.languages.md = (function () {
|
||||
pattern: /^[ \t]*([*+\-]|\d+\.)[ \t].+(?:\n|[ \t].*\n)*/gm,
|
||||
inside: {
|
||||
"md md-li": /^[ \t]*([*+\-]|\d+\.)[ \t]/m,
|
||||
'pre gfm': /^((?: {4}|\t)+)`{3}.*\n(?:[\s\S]*?)\n\1`{3} *$/gm,
|
||||
'pre gfm': {
|
||||
pattern: /^((?: {4}|\t)+)`{3}.*\n(?:[\s\S]*?)\n\1`{3} *$/gm,
|
||||
inside: {
|
||||
"md md-pre": /`{3}/,
|
||||
lf: lf
|
||||
}
|
||||
},
|
||||
lf: lf
|
||||
}
|
||||
};
|
||||
@ -288,8 +294,6 @@ Prism.languages.md = (function () {
|
||||
link: md.link,
|
||||
imgref: md.imgref,
|
||||
linkref: md.linkref,
|
||||
url: md.url,
|
||||
email: md.email,
|
||||
strong: md.strong,
|
||||
em: md.em,
|
||||
strike: md.strike,
|
||||
@ -301,7 +305,7 @@ Prism.languages.md = (function () {
|
||||
email: emailPattern
|
||||
};
|
||||
|
||||
for (var c = 6; c >= 1; c--) {
|
||||
for(var c = 6; c >= 1; c--) {
|
||||
md["h" + c].inside.rest = rest;
|
||||
}
|
||||
md["h1 alt"].inside.rest = rest;
|
||||
|
Loading…
Reference in New Issue
Block a user