fix: safari浏览器兼容性

This commit is contained in:
kuaifan 2022-11-24 16:02:59 +08:00
parent 65dedcd9ff
commit de5cbe994d

View File

@ -422,7 +422,7 @@
if (/https*:\/\//.test(text)) {
text = text.split(/(<[^>]*>)/g).map(string => {
if (string && !/<[^>]*>/.test(string)) {
string = string.replace(/(?<=[^'"])(https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#)+)/g, "<a href=\"$1$2\" target=\"_blank\">$1$2</a>")
string = string.replace(/([^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#)+))/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>")
}
return string;
}).join("")