MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / ensureLinksOpenInNewTab

Function ensureLinksOpenInNewTab

web/js/chat.js:169–179  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

167}
168
169function ensureLinksOpenInNewTab(html) {
170 const template = document.createElement("template");
171 template.innerHTML = html;
172
173 template.content.querySelectorAll("a[href]").forEach((linkEl) => {
174 linkEl.setAttribute("target", "_blank");
175 linkEl.setAttribute("rel", "noopener noreferrer");
176 });
177
178 return template.innerHTML;
179}
180
181function renderEmbeddedMarkdownBlocks(html) {
182 const template = document.createElement("template");

Callers 2

renderMarkdownFunction · 0.85
handleAgentEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected