Add a capability to convert HTML content into the Block Editor’s normalized block schema. This enables seamless migration/import of existing HTML-based content and integration with external sources, preserving structure, nesting, and inline formatting while sanitizing unsafe markup. The feature is extensible for custom elements and resilient to malformed HTML.
Requirements:
- Public API: Provide a documented method to parse HTML and return Block Editor blocks, plus an optional editor helper.
- Mapping coverage: Support headings, paragraphs, inline marks (bold/italic/code/links), lists (nested), quotes, code blocks, images, tables, HR, and line breaks.
- Sanitization: Sanitize input with a configurable allowlist for tags/attributes.
- Fidelity: Preserve nesting, order, whitespace, entities; handle relative URLs optionally.