Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
content = content.replace(re, "");
string = "x-scope " + tags[i] + "-0";
re = new RegExp(string, "g");
content = content.replace(re, "");
}
}
// remove empty class structures
content = content.replace(/\sclass=\"\"/g, "");
content = content.replace(/\sclass=\"\s\"/g, "");
// re-apply contenteditable if needed
this._applyContentEditable(this.editMode);
// set active again
window.HaxStore.write("activeNode", __active, this);
window.HaxStore.write("activeContainerNode", __active, this);
// oh one last thing. escape all script/style tags
content = encapScript(content);
if (this.globalPreferences.haxDeveloperMode) {
console.warn(content);
}
return content;
}
/**
_activeItemContentChanged(newValue, oldValue) {
if (newValue) {
var html = newValue;
// only append if not empty
if (html !== null) {
wipeSlot(this, "*");
html = encapScript(newValue);
// insert the content as quickly as possible, then work on the dynamic imports
microTask.run(() => {
setTimeout(() => {
let frag = document.createRange().createContextualFragment(html);
this.appendChild(frag);
const evt = new CustomEvent(
"json-outline-schema-active-body-changed",
{
bubbles: true,
composed: true,
cancelable: false,
detail: { html }
}
);
}, 5);
});
setTimeout(() => {
html = encapScript(html);
let fragment = document.createElement("div");
fragment.insertAdjacentHTML("beforeend", html);
while (fragment.firstChild !== null) {
if (typeof fragment.firstChild.tagName !== typeof undefined) {
// ensure import doesn't import non-sandbox safe things!
if (
window.HaxStore.instance._isSandboxed &&
fragment.firstChild.tagName.toLowerCase() === "iframe"
) {
// Create a replacement tag of the desired type
var replacement = document.createElement("webview");
// Grab all of the original's attributes, and pass them to the replacement
for (
var j = 0, l = fragment.firstChild.attributes.length;
j < l;
++j
_itemContentChanged(newValue, oldValue) {
if (newValue) {
var html = newValue;
// only append if not empty
if (html !== null) {
html = encapScript(newValue);
wipeSlot(this, "*");
// insert the content as quickly as possible, then work on the dynamic imports
microTask.run(() => {
setTimeout(() => {
let frag = document.createRange().createContextualFragment(html);
this.appendChild(frag);
}, 5);
});
// if there are, dynamically import them
if (varExists(this.manifest, "metadata.node.dynamicElementLoader")) {
let tagsFound = findTagsInHTML(html);
const basePath = this.pathFromUrl(
decodeURIComponent(import.meta.url)
);
for (var i in tagsFound) {
const tagName = tagsFound[i];
_activeItemContentChanged(newValue, oldValue) {
if (newValue) {
var html = newValue;
// only append if not empty
if (html !== null) {
wipeSlot(store.themeElement, "*");
html = encapScript(newValue);
// set in the store
store.activeItemContent = html;
// insert the content as quickly as possible, then work on the dynamic imports
setTimeout(() => {
if (store.themeElement.childNodes.length === 0) {
let frag = document.createRange().createContextualFragment(html);
store.themeElement.appendChild(frag);
this.dispatchEvent(
new CustomEvent("json-outline-schema-active-body-changed", {
bubbles: true,
composed: true,
cancelable: false,
detail: html
})
);
}
_valueChanged(newValue) {
// clear self
wipeSlot(this);
// sanity check to ditch scripts
let html = encapScript(newValue);
let frag = document.createRange().createContextualFragment(html);
// self apend to flow into slot and show up
this.appendChild(frag);
}
}
window.HaxStore.encapScript = html => {
return encapScript(html);
};
/**