feat: add config option to disable external link warning
Since it is heavily requested by users, this adds a new config option to disable the previously introduced external link warning. Be aware however, that disabling this config option weakens the security of your HedgeDoc instance and is therefore only recommended for closed trustworthy user groups. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
committed by
Philip Molares
parent
d20619315e
commit
0ebf0dbc6b
@@ -592,6 +592,9 @@ window.postProcess = postProcess
|
||||
|
||||
// rewrite external links to go through the /_link warning page
|
||||
export function rewriteExternalLinks (view) {
|
||||
if (window.externalLinkWarning === false) {
|
||||
return
|
||||
}
|
||||
const whitelist = window.externalLinkWhitelist || []
|
||||
view.find('a[href]').each((index, linkTag) => {
|
||||
const anchor = $(linkTag)
|
||||
|
||||
@@ -8,6 +8,7 @@ window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %>
|
||||
|
||||
window.linkifyHeaderStyle = '<%- linkifyHeaderStyle %>'
|
||||
|
||||
window.externalLinkWarning = <%- JSON.stringify(externalLinkWarning) %>
|
||||
window.externalLinkWhitelist = <%- JSON.stringify(externalLinkWhitelist) %>
|
||||
|
||||
window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>'
|
||||
|
||||
Reference in New Issue
Block a user