1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 22:33:16 +00:00

Markdown plugin: add rel="noopener noreferrer" to external links (#4771)

This commit is contained in:
ento 2020-11-08 02:47:44 -09:00 committed by GitHub
parent e72d90c227
commit e574cb4724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,8 @@ function convertNodes(remarkableTree, isStartOfInline) {
// External link // External link
var attributes = { var attributes = {
class: { type: "string", value: "tc-tiddlylink-external" }, class: { type: "string", value: "tc-tiddlylink-external" },
href: { type: "string", value: currentNode.href } href: { type: "string", value: currentNode.href },
rel: { type: "string", value: "noopener noreferrer" }
}; };
if (pluginOpts.linkNewWindow) { if (pluginOpts.linkNewWindow) {
attributes.target = { type: "string", value: "_blank" }; attributes.target = { type: "string", value: "_blank" };