fix hyperdown

This commit is contained in:
joyqi
2021-06-22 12:15:00 +08:00
parent db6825a33d
commit 70068ed5a1
3 changed files with 9 additions and 12 deletions
+3 -6
View File
@@ -1138,14 +1138,11 @@
};
Parser.prototype.cleanUrl = function(url) {
var matches;
if (!!(matches = url.match(/^\s*(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*))/))) {
return matches[1];
} else if (!!(matches = url.match(/^\s*([-a-zA-Z0-9()@:%_\+.~#?&\/=]+)/))) {
return matches[1];
} else {
url = url.replace(/["'<>\s]/g, '');
if ((url.match(/^\w+:/i)) && !(url.match(/^https?:/i))) {
return '#';
}
return url;
};
Parser.prototype.escapeBracket = function(str) {