fuzzyworld

tools / commit

all MD links now open in a new tab

89528c89ce985364dd346b710b186c2e3de27e1d · Pavel Safronov · 2025-07-30 16:08:23 -0700 · parents 0e04e2d53499

all MD links now open in a new tab
 separator-page/index.html | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/separator-page/index.html b/separator-page/index.html
index cfaecda..eda857e 100644
--- a/separator-page/index.html
+++ b/separator-page/index.html
@@ -558,6 +558,12 @@ technically *some* scripts can get your local separator page info
             descriptionElement.style.height = `${descriptionElement.scrollHeight}px`;
             const html = converter.makeHtml(description);
             descriptionRendered.innerHTML = html;
+            // update all rendered links to open in a new tab
+            const links = descriptionRendered.querySelectorAll("a");
+            links.forEach(link => {
+                link.setAttribute("target", "_blank");
+                link.setAttribute("rel", "noopener noreferrer");
+            });
         }
 
         function handleIconChange(iconUrl) {