update hyperdown

This commit is contained in:
joyqi
2021-07-21 14:44:28 +08:00
parent 3dd592ae59
commit 27e6801e15
3 changed files with 3 additions and 3 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -407,7 +407,7 @@
})(this));
text = this.parseInlineCallback(text);
if (enableAutoLink) {
text = text.replace(/(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/g, (function(_this) {
text = text.replace(/(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/g, (function(_this) {
return function() {
var link, matches, url;
matches = 1 <= arguments.length ? slice.call(arguments, 0) : [];
+1 -1
View File
@@ -541,7 +541,7 @@ class HyperDown
// autolink url
if ($enableAutoLink) {
$text = preg_replace_callback(
"/(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/",
"/(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/",
function ($matches) use ($self) {
$url = $self->cleanUrl($matches[2]);
$link = $self->call('parseLink', $matches[2]);