Mention and tag links are not considered the acct data
This commit is contained in:
parent
78ea495969
commit
7d6d0b5628
|
@ -3,6 +3,7 @@
|
|||
$(document).on('click', 'a', e => {
|
||||
var $a = $(e.target)
|
||||
var url = $a.attr('href')
|
||||
var acct_id = $a.attr('data-acct')
|
||||
if (!url) {
|
||||
var url = $a.parent().attr('href')
|
||||
}
|
||||
|
@ -43,7 +44,11 @@ $(document).on('click', 'a', e => {
|
|||
if (ats[2]) {
|
||||
//Quesdon判定
|
||||
if (!~ats[2].indexOf('@')) {
|
||||
udgEx(url, 'main')
|
||||
var acct_id = $a.parent().attr('data-acct')
|
||||
if (!acct_id) {
|
||||
acct_id = localStorage.getItem("main")
|
||||
}
|
||||
udgEx(url, acct_id)
|
||||
return false
|
||||
} else {
|
||||
if (pwa) {
|
||||
|
@ -144,8 +149,7 @@ onmessage = function(e) {
|
|||
} else if (e.data[0] == 'post') {
|
||||
post('pass')
|
||||
} else if (e.data[0] == 'toastSaved') {
|
||||
var showTxt = `${lang.lang_img_DLDone}${
|
||||
e.data[1][0]
|
||||
var showTxt = `${lang.lang_img_DLDone}${e.data[1][0]
|
||||
}<button class="btn-flat toast-action" onclick="openFinder('${e.data[1][1]}')">Show</button>`
|
||||
M.toast({ html: showTxt, displayLength: 5000 })
|
||||
} else if (e.data[0] == 'parseColumn') {
|
||||
|
|
|
@ -560,6 +560,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) {
|
|||
/https?:\/\/([^+_]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||
)
|
||||
urlsck = content.match(/(https?):\/\/([^<>]*?)\/([^"]*)/g)
|
||||
content = content.replace(/href="([^"]+)"/g, `href="$1" data-acct="${acct_id}"`)
|
||||
if (urlsck) {
|
||||
for (var urlct = 0; urlct < urlsck.length; urlct++) {
|
||||
var urlindv = urlsck[urlct]
|
||||
|
@ -569,12 +570,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) {
|
|||
var encoded = encodeURI(urlCont[4])
|
||||
var punycoded = 'xn--' + punycode.encode(urlCont[2])
|
||||
var eUrl = urlCont[1] + '://' + punycoded + '.' + urlCont[3] + '/' + encoded
|
||||
var regExp = new RegExp('href="' + urlindv + '"', 'g')
|
||||
content = content.replace(regExp, 'href="' + eUrl + '"')
|
||||
var regExp = new RegExp(`href="${urlindv}"`, 'g')
|
||||
content = content.replace(regExp, `href="${eUrl}"`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (urls) {
|
||||
var analyze = `<a onclick="additionalIndv('${tlid}','${acct_id}','${id}')" class="add-show pointer" aria-hidden="true">
|
||||
${lang.lang_parse_url}
|
||||
|
|
Loading…
Reference in New Issue
Block a user