fix(regex): simplify the hrefMatcher

feat/fix/umd
SukkaW 7 years ago
parent cbc78976b4
commit b8d4b24e68

@ -417,7 +417,7 @@ function DisqusJS(config) {
let removeDisqUs = (msg) => {
// aMatcher - 只处理 Disqus 短链接
var aMatcher = new RegExp(/<a.+?href=\"https:\/\/disq.us(.+?)\".*>/gi),
hrefMatcher = new RegExp(/href=\"(?<href>[^\"]*)\"/gi)
hrefMatcher = new RegExp(/href=\"(.+?)\"/gi)
let link = (msg.match(aMatcher) || [])
link.map((link) => {
// (.*) 是贪婪处理,会一致匹配到最后,可以用于匹配最后一次

Loading…
Cancel
Save