HTML ↔ [devup_editor_core::Document] conversion for the devup editor.
Implements [DocumentExport] and [DocumentImport] from
devup-editor-core, plus a clipboard-oriented API
([blocks_to_html] / [html_to_copied_blocks]) that mirrors the
behaviour of the React TypeScript clipboardHtml.ts exactly so
clipboard interop with Word / Notion / Google Docs keeps working.
Structural support
Export and import both cover:
- Headings (h1–h6)
- Paragraphs (p)
- Quotes (blockquote)
- Pre / code (language class preserved)
- Unordered & ordered lists (with nested indent tracking)
- Todo lists (via
<ul data-devup-type="todo">marker OR<input type="checkbox">heuristic OR Notion<ul class="to-do-list">) - Dividers (hr)
- Toggle blocks:
<details><summary>, Notion<ul class="toggle">, plus Notion v3's<li>-with-multiple-block-children heuristic - Tables:
colspan,rowspan,<colgroup>widths, cell / row / table styling viadata-devup-propsmarker and inlinestyle=""
Marks on export wrap text in <strong>, <em>, <u>, <s>,
<code>, <a href="…" rel="noopener noreferrer">, and
<span style="color:…"> / <span style="background-color:…"> for
color / highlight. Unknown mark types survive via a
<span data-mark="type"> fallback so copy never silently drops text.
Clipboard-specific features
The clipboard module provides:
- [
encode_props] / [decode_props] — base64+JSON round-trip marker (data-devup-props="…") for lossless devup→devup copy/paste of table prop maps. - [
clean_html] — strips Word / HWP preprocessing artifacts (<!--StartFragment-->,<o:p>tags) before parsing.
See [CopiedBlocks] for the clipboard subtree shape used by the
React layer.