@scrider/formatter 1.6.0 → 1.6.1
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/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2040,7 +2040,7 @@ var EMBED_RENDERERS = {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
|
|
2042
2042
|
const embedSrc = toCodeWidgetEmbedUrl(src);
|
|
2043
|
-
return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
|
|
2043
|
+
return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}"${float}${style}></iframe>`;
|
|
2044
2044
|
},
|
|
2045
2045
|
formula: (value) => {
|
|
2046
2046
|
const latex = typeof value === "string" ? value : "";
|
|
@@ -2160,6 +2160,7 @@ function appendQueryParam(url, key, value) {
|
|
|
2160
2160
|
const next = query ? `${query}&${key}=${value}` : `?${key}=${value}`;
|
|
2161
2161
|
return `${base}${next}${hash}`;
|
|
2162
2162
|
}
|
|
2163
|
+
var CODE_WIDGET_IFRAME_ALLOW = "accelerometer; camera; encrypted-media; geolocation; gyroscope; microphone; midi; payment; usb; vr; xr-spatial-tracking; cross-origin-isolated";
|
|
2163
2164
|
function toCodeWidgetEmbedUrl(url) {
|
|
2164
2165
|
const u = typeof url === "string" ? url.trim() : "";
|
|
2165
2166
|
if (!u) return "";
|
|
@@ -2228,7 +2229,7 @@ var codeWidgetFormat = {
|
|
|
2228
2229
|
}
|
|
2229
2230
|
const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
|
|
2230
2231
|
const embedSrc = toCodeWidgetEmbedUrl(src);
|
|
2231
|
-
return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
|
|
2232
|
+
return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}"${float}${style}></iframe>`;
|
|
2232
2233
|
},
|
|
2233
2234
|
match(element) {
|
|
2234
2235
|
if (element.tagName.toLowerCase() !== "iframe") return null;
|