MCPcopy Create free account
hub / github.com/zxlie/FeHelper / createSafeToastHTML

Function createSafeToastHTML

apps/json-format/json-utils.js:400–409  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

398
399// ─── toast 安全版(XSS 防护)────────────────────────────────
400export function createSafeToastHTML(content) {
401 const safe = htmlspecialchars(content);
402 return (
403 '<div id="fehelper_alertmsg" style="position:fixed;top:5px;right:5px;z-index:1000000">' +
404 '<p style="background:#000;display:inline-block;color:#fff;text-align:center;' +
405 'padding:10px 10px;margin:0 auto;font-size:14px;border-radius:4px;">' +
406 safe +
407 '</p></div>'
408 );
409}

Callers 1

json-utils.test.jsFile · 0.90

Calls 1

htmlspecialcharsFunction · 0.70

Tested by

no test coverage detected