@scrider/formatter 1.6.0 → 1.6.2
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 +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2019,7 +2019,7 @@ var EMBED_RENDERERS = {
|
|
|
2019
2019
|
const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
|
|
2020
2020
|
const embedSrc = toVideoEmbedUrl(src);
|
|
2021
2021
|
if (embedSrc) {
|
|
2022
|
-
return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
|
|
2022
|
+
return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen credentialless${float}${style}></iframe>`;
|
|
2023
2023
|
}
|
|
2024
2024
|
return `<video src="${escapeHtml(src)}" controls${float}${style}></video>`;
|
|
2025
2025
|
},
|
|
@@ -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}" credentialless${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}" credentialless${float}${style}></iframe>`;
|
|
2232
2233
|
},
|
|
2233
2234
|
match(element) {
|
|
2234
2235
|
if (element.tagName.toLowerCase() !== "iframe") return null;
|
|
@@ -2492,7 +2493,7 @@ var videoFormat = {
|
|
|
2492
2493
|
const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
|
|
2493
2494
|
const embedSrc = toVideoEmbedUrl(src);
|
|
2494
2495
|
if (embedSrc) {
|
|
2495
|
-
return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
|
|
2496
|
+
return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen credentialless${float}${style}></iframe>`;
|
|
2496
2497
|
}
|
|
2497
2498
|
return `<video src="${escapeHtml(src)}" controls${float}${style}></video>`;
|
|
2498
2499
|
},
|