@innovastudio/contentbuilder 1.4.35 → 1.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -4974,6 +4974,7 @@ class Util {
|
|
4974
4974
|
// Render custom code block
|
4975
4975
|
html = decodeURIComponent(block.getAttribute('data-html'));
|
4976
4976
|
html = html.replace(/{id}/g, this.makeId());
|
4977
|
+
html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
|
4977
4978
|
|
4978
4979
|
for (var i = 1; i <= 20; i++) {
|
4979
4980
|
html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
|
@@ -54193,6 +54194,7 @@ class Module {
|
|
54193
54194
|
const iframe = moduleModal.querySelector('iframe');
|
54194
54195
|
let result = await fetch(this.builder.opts.modulePath + modulename + '.html');
|
54195
54196
|
result = await result.text();
|
54197
|
+
result = result.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
|
54196
54198
|
let doc = iframe.contentWindow.document;
|
54197
54199
|
doc.open();
|
54198
54200
|
doc.write(result);
|
@@ -54214,6 +54216,7 @@ class Module {
|
|
54214
54216
|
|
54215
54217
|
let html = this.builderStuff.querySelector('#hidContentModuleCode').value;
|
54216
54218
|
html = html.replace(/{id}/g, this.util.makeId());
|
54219
|
+
html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
|
54217
54220
|
/* OLD
|
54218
54221
|
for(var i=1;i<=20;i++){ // OLD
|
54219
54222
|
html = html.replace('[%HTML'+i+'%]', (module.getAttribute('data-html-'+i) === undefined ? '' : decodeURIComponent(module.getAttribute('data-html-'+i))));//render editable area
|
@@ -54390,6 +54393,7 @@ class Code {
|
|
54390
54393
|
});
|
54391
54394
|
let html = decodeURIComponent(codeblock.getAttribute('data-html')); //html = html.replace(/{id}/g, this.util.makeId());
|
54392
54395
|
|
54396
|
+
html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
|
54393
54397
|
tmpbuilder.parentNode.removeChild(tmpbuilder); // Use existing modal
|
54394
54398
|
|
54395
54399
|
let viewhtml;
|
@@ -79343,6 +79347,7 @@ class ContentBuilder {
|
|
79343
79347
|
// Render custom code block
|
79344
79348
|
html = decodeURIComponent(block.getAttribute('data-html'));
|
79345
79349
|
html = html.replace(/{id}/g, util.makeId());
|
79350
|
+
html = html.replace(/<script>/g, `${this.nonce ? `<script nonce="${this.nonce}">` : '<script>'}`);
|
79346
79351
|
|
79347
79352
|
for (var i = 1; i <= 20; i++) {
|
79348
79353
|
html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
|
@@ -81971,6 +81976,7 @@ class ContentBuilder {
|
|
81971
81976
|
// Render custom code block
|
81972
81977
|
html = decodeURIComponent(block.getAttribute('data-html'));
|
81973
81978
|
html = html.replace(/{id}/g, this.util.makeId());
|
81979
|
+
html = html.replace(/<script>/g, `${this.nonce ? `<script nonce="${this.nonce}">` : '<script>'}`);
|
81974
81980
|
|
81975
81981
|
for (var i = 1; i <= 20; i++) {
|
81976
81982
|
html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
|