rapier-markdown-kit 1.2.56 → 1.2.58
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/README.md +2 -2
- package/dist/spec/html-blocks.mjs +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -690,7 +690,7 @@ value the editor's release reads.
|
|
|
690
690
|
## Where the modules live
|
|
691
691
|
|
|
692
692
|
Each module has one home in the Rapier source (`spec/`, `layout/`, `agent/`, `kit/`), where Rapier itself reads it; `dist/`
|
|
693
|
-
is
|
|
693
|
+
is an exact copy of that closure, and `style.css` is the same `spec/markdown-style.css` Rapier bundles.
|
|
694
694
|
|
|
695
695
|
|
|
696
696
|
## rapier-ledger
|
|
@@ -821,7 +821,7 @@ The writer escapes `<` and `>` in that JSON. This versioned EOF marker is reserv
|
|
|
821
821
|
an unfinished marker is refused, not silently imported as prose. The reader strips
|
|
822
822
|
only that exact suffix, validates it against the remaining exact text, and treats a
|
|
823
823
|
leading BOM as file metadata. Other Markdown readers ignore the comment. Plain
|
|
824
|
-
saves without a choice are unchanged
|
|
824
|
+
saves without a choice are unchanged. For executable code, use a web
|
|
825
825
|
page to carry metadata rather than appending a Markdown comment to program source.
|
|
826
826
|
|
|
827
827
|
The comparison page's `#rapier-base` is independent: `text/markdown`, with
|
|
@@ -419,6 +419,7 @@ export function mountHtmlBlocks(doc, options = {}) {
|
|
|
419
419
|
if (++count > 512) throw new Error('HTML node budget exceeded');
|
|
420
420
|
const tag = el.localName.toLowerCase();
|
|
421
421
|
if (!allowed.has(tag)) {el.remove(); continue;}
|
|
422
|
+
if (el.namespaceURI === 'http://www.w3.org/1999/xhtml' && el.parentNode?.namespaceURI === 'http://www.w3.org/2000/svg') {el.remove(); continue;}
|
|
422
423
|
if (tag === 'style') el.textContent = css(el.textContent);
|
|
423
424
|
if (el.hasAttribute('style')) el.setAttribute('style', css(el.getAttribute('style')));
|
|
424
425
|
for (const attr of [...el.attributes]) {
|
|
@@ -451,10 +452,10 @@ export function mountHtmlBlocks(doc, options = {}) {
|
|
|
451
452
|
if (/<!\s*(?:DOCTYPE|ENTITY)\b/i.test(svgText)) throw new Error('SVG declarations are unsupported');
|
|
452
453
|
const parsed = new win.DOMParser().parseFromString(svgText, 'image/svg+xml');
|
|
453
454
|
if (parsed.querySelector('parsererror') || parsed.documentElement.localName !== 'svg') throw new Error('Invalid SVG image');
|
|
454
|
-
const svg =
|
|
455
|
+
const inert = template.content.ownerDocument, svg = inert.importNode(parsed.documentElement, true);
|
|
455
456
|
if (el.getAttribute('style')) svg.setAttribute('style', el.getAttribute('style'));
|
|
456
457
|
for (const key of ['width','height','class','id']) if (el.hasAttribute(key)) svg.setAttribute(key, el.getAttribute(key));
|
|
457
|
-
const holder =
|
|
458
|
+
const holder = inert.createElement('div'); holder.append(svg); walk(holder); el.replaceWith(svg); continue;
|
|
458
459
|
}
|
|
459
460
|
el.setAttribute(name, info.first ? 'data:image/gif;base64,' + media.encode(info.first) : url);
|
|
460
461
|
if (info.animated) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-markdown-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.58",
|
|
4
4
|
"description": "Read, render and write Self-contained Markdown: one .md file that carries its pictures, drawings and layout, and that any Markdown app can read. HTML renderer, stylesheet, text layout, Will/1 agent permissions, and an edit history with authorship and offline merge. MIT, no dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|