Files
to_docx/client/node_modules/@iconify/utils/lib/svg/inner-html.js
T
Chen Xiao 0b64e2de94 First commit.
Signed-off-by: Chen Xiao <abigwc@gmail.com>
2026-05-08 14:43:16 +08:00

23 lines
535 B
JavaScript

let policy;
/**
* Attempt to create policy
*/
function createPolicy() {
try {
policy = window.trustedTypes.createPolicy("iconify", { createHTML: (s) => s });
} catch (err) {
policy = null;
}
}
/**
* Clean up value for innerHTML assignment
*
* This code doesn't actually clean up anything.
* It is intended be used with Iconify icon data, which has already been validated
*/
function cleanUpInnerHTML(html) {
if (policy === void 0) createPolicy();
return policy ? policy.createHTML(html) : html;
}
export { cleanUpInnerHTML };