@scrider/formatter 1.10.0 → 1.10.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 +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -459,9 +459,13 @@ var EMBED_RENDERERS = {
|
|
|
459
459
|
const embedSrc = toCodeWidgetEmbedUrl(src);
|
|
460
460
|
return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${renderEmbedIframeIsolationAttrs(context, "codeWidget")}${float}${style}></iframe>`;
|
|
461
461
|
},
|
|
462
|
+
// `data-scrider-embed` marks this span as 1 Delta char for DomBridge before
|
|
463
|
+
// KaTeX post-render replaces the text body with a `.katex` subtree. Without
|
|
464
|
+
// the marker, DomBridge counts the raw LaTeX length and drifts indices for
|
|
465
|
+
// everything after the formula (e.g. Simple Table chrome probe fails).
|
|
462
466
|
formula: (value) => {
|
|
463
467
|
const latex = typeof value === "string" ? value : "";
|
|
464
|
-
return `<span class="formula" data-formula="${escapeHtml(latex)}">${escapeHtml(latex)}</span>`;
|
|
468
|
+
return `<span class="formula" data-formula="${escapeHtml(latex)}" data-scrider-embed>${escapeHtml(latex)}</span>`;
|
|
465
469
|
},
|
|
466
470
|
diagram: (value) => {
|
|
467
471
|
const source = typeof value === "string" ? value : "";
|
|
@@ -2587,7 +2591,7 @@ var formulaFormat = {
|
|
|
2587
2591
|
},
|
|
2588
2592
|
render(value) {
|
|
2589
2593
|
const latex = typeof value === "string" ? value : "";
|
|
2590
|
-
return `<span class="formula" data-formula="${escapeHtml(latex)}">${escapeHtml(latex)}</span>`;
|
|
2594
|
+
return `<span class="formula" data-formula="${escapeHtml(latex)}" data-scrider-embed>${escapeHtml(latex)}</span>`;
|
|
2591
2595
|
},
|
|
2592
2596
|
match(element) {
|
|
2593
2597
|
if (element.tagName.toLowerCase() !== "span") return null;
|