fix: open links in new tab
The addition of external link warning has changed the behavior of opening links from opening in a new tab to opening in the same tab. This restores the old behavior and opens all links in a new tab. Signed-off-by: Tony Chau <90050474+fo5for@users.noreply.github.com>
This commit is contained in:
committed by
Erik Michelson
parent
d05cfe4e9f
commit
ffcf79ef07
@@ -1,10 +1,6 @@
|
||||
module.exports = {
|
||||
serveLinkWarningPage: function (req, res) {
|
||||
let targetURL = typeof req.query.url === 'string' ? req.query.url : ''
|
||||
let noteURL = typeof req.query.note === 'string' ? req.query.note : ''
|
||||
if (noteURL !== '' && !/^[\w-]+$/.test(noteURL)) {
|
||||
noteURL = ''
|
||||
}
|
||||
let valid = false
|
||||
try {
|
||||
targetURL = decodeURIComponent(targetURL)
|
||||
@@ -20,8 +16,8 @@ module.exports = {
|
||||
res.render('link.ejs', {
|
||||
title: 'External link',
|
||||
valid,
|
||||
noteURL,
|
||||
targetURL,
|
||||
cspNonce: res.locals.nonce,
|
||||
opengraph: []
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user