Open blocked links in a different tab

merge-requests/30/head
Bob Mottram 2021-07-23 14:50:32 +01:00
parent 4ebbe4916b
commit 0c36d99e28
2 changed files with 11 additions and 4 deletions

View File

@ -512,6 +512,7 @@ def _getCommonWords() -> str:
'using', 'uses', 'https', 'still', 'want', 'wants' 'using', 'uses', 'https', 'still', 'want', 'wants'
) )
def _updateWordFrequency(content: str, wordFrequency: {}) -> None: def _updateWordFrequency(content: str, wordFrequency: {}) -> None:
"""Creates a dictionary containing words and the number of times """Creates a dictionary containing words and the number of times
that they appear that they appear

View File

@ -145,7 +145,9 @@ def htmlAccountInfo(cssCache: {}, translate: {},
ctr = 1 ctr = 1
for postDomain, blockedPostUrls in domainDict.items(): for postDomain, blockedPostUrls in domainDict.items():
infoForm += '<a href="' + \ infoForm += '<a href="' + \
httpPrefix + '://' + postDomain + '">' + postDomain + '</a> ' httpPrefix + '://' + postDomain + '" ' + \
'target="_blank" rel="nofollow noopener noreferrer">' + \
postDomain + '</a> '
if isBlockedDomain(baseDir, postDomain): if isBlockedDomain(baseDir, postDomain):
blockedPostsLinks = '' blockedPostsLinks = ''
urlCtr = 0 urlCtr = 0
@ -153,7 +155,9 @@ def htmlAccountInfo(cssCache: {}, translate: {},
if urlCtr > 0: if urlCtr > 0:
blockedPostsLinks += '<br>' blockedPostsLinks += '<br>'
blockedPostsLinks += \ blockedPostsLinks += \
'<a href="' + url + '">' + url + '</a>' '<a href="' + url + '" ' + \
'target="_blank" rel="nofollow noopener noreferrer">' + \
url + '</a>'
urlCtr += 1 urlCtr += 1
blockedPostsHtml = '' blockedPostsHtml = ''
if blockedPostsLinks: if blockedPostsLinks:
@ -194,7 +198,8 @@ def htmlAccountInfo(cssCache: {}, translate: {},
followingDomain, followingPort = getDomainFromActor(actor) followingDomain, followingPort = getDomainFromActor(actor)
followingDomainFull = \ followingDomainFull = \
getFullDomain(followingDomain, followingPort) getFullDomain(followingDomain, followingPort)
infoForm += '<a href="' + actor + '">' + \ infoForm += '<a href="' + actor + '" ' + \
'target="_blank" rel="nofollow noopener noreferrer">' + \
followingNickname + '@' + followingDomainFull + \ followingNickname + '@' + followingDomainFull + \
'</a><br><br>\n' '</a><br><br>\n'
infoForm += '</div>\n' infoForm += '</div>\n'
@ -211,7 +216,8 @@ def htmlAccountInfo(cssCache: {}, translate: {},
followerNickname = getNicknameFromActor(actor) followerNickname = getNicknameFromActor(actor)
followerDomain, followerPort = getDomainFromActor(actor) followerDomain, followerPort = getDomainFromActor(actor)
followerDomainFull = getFullDomain(followerDomain, followerPort) followerDomainFull = getFullDomain(followerDomain, followerPort)
infoForm += '<a href="' + actor + '">' + \ infoForm += '<a href="' + actor + '" ' + \
'target="_blank" rel="nofollow noopener noreferrer">' + \
followerNickname + '@' + followerDomainFull + '</a><br><br>\n' followerNickname + '@' + followerDomainFull + '</a><br><br>\n'
infoForm += '</div>\n' infoForm += '</div>\n'