From e574cb472497ffc1807c51d0f864576b17273e5b Mon Sep 17 00:00:00 2001 From: ento Date: Sun, 8 Nov 2020 02:47:44 -0900 Subject: [PATCH] Markdown plugin: add rel="noopener noreferrer" to external links (#4771) --- plugins/tiddlywiki/markdown/wrapper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js index 803f1a7ca..e7a97fadb 100755 --- a/plugins/tiddlywiki/markdown/wrapper.js +++ b/plugins/tiddlywiki/markdown/wrapper.js @@ -119,7 +119,8 @@ function convertNodes(remarkableTree, isStartOfInline) { // External link var attributes = { 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) { attributes.target = { type: "string", value: "_blank" };