v0.5.0 — traditional-content coverage & inline-SVG crash fix
The layer between generated content and WordPress just got much broader coverage — and stopped crashing on inline SVG.
Fixed
- Inline SVG (and any foreign element) no longer crashes conversion. An
<svg>/MathML node anywhere threwclassName.split is not a functionand aborted the whole run with no output. Foreign elements now route to Custom HTML, and a per-rule error boundary guarantees no single node can abort a run.
Added
- Native-block coverage for traditional content:
<table>→core/table(colspan/rowspan/scope +<caption>),<blockquote>→core/quote,<pre><code>/<pre>→core/code/core/preformatted,<hr>→core/separator,<video>/<audio>→core/video/core/audio(+<track>),<details>→core/details, YouTube/Vimeo<iframe>→core/embed, multi-image<figure>→core/gallery, with a<figure>dispatcher for captions. - Atomic enclosing-unit fallback. When a block's rich text holds content the editor can't keep (inline SVG/iframe, block-level markup), the whole enclosing block falls back to Custom HTML with a warning at the offending node. Decorative empty inline hooks are stripped so blocks stay native; empty semantic elements (
id/href/datetime/aria-*) fall back instead of being lost.
Security
- Hardened URL sanitization: control-char/whitespace-obfuscated
javascript:/vbscript:and executable<iframe srcdoc>are stripped. - Exact-hostname embed matching over HTTPS, so lookalike domains (
notyoutube.com) can't be rewritten into a trustedcore/embed.
Codex Review
2 review passes. Final: all actionable findings resolved.
- ✅ Addressed: embed lookalike-domain trust-boundary bypass — exact-hostname URL parsing.
- ✅ Addressed:
data:/control-char URL schemes in rich text — normalized + rejected. - ✅ Addressed: silent loss of gallery images / table captions / video tracks / mixed-figure content — all carried or preserved via group.
- ✅ Addressed: semantic empty inline elements stripped — now fall back to Custom HTML.
- ✋ By design: presentational attributes (class/style/preload) are shed for clean native blocks, consistent with every existing rule; content-bearing attributes are carried.
Full transcript: .git/codex-review-main.log (local).