diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index b0f6d2d..ecd1132 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -30,6 +30,10 @@ Provide a cookbook showing how to prompt LLMs to draft block maps/entity decorat > Possible changes that require R&D, and high-risk ideas that could bring large benefits but with likely trade-offs. +### Markdown importer + +`markdown_to_content_state(markdown, options)` parses Markdown back into Draft.js ContentState, enabling round-trip workflows (ContentState → Markdown → ContentState). The parser is dependency-free and mirrors the exporter's configurable markers. It supports the Markdown subset the exporter produces, plus common CommonMark edge cases (escapes, HR variants, link titles, code fence info strings, multi-line blockquotes, `)` ordered-list delimiters, `~~~` fences). Inline HTML tags (``, ``, etc.) emitted by the exporter for non-Markdown styles are parsed back into `inlineStyleRanges`. + ### Rust-backed DOM engine Prototype a Rust extension or PyO3 module for DOM construction to outperform the current string/lxml/html5lib engines on large documents. diff --git a/docs/contributing/architecture.md b/docs/contributing/architecture.md index bdfb0be..6203dbf 100644 --- a/docs/contributing/architecture.md +++ b/docs/contributing/architecture.md @@ -25,7 +25,8 @@ draftjs_exporter/ html5lib.py # BeautifulSoup / html5lib engine. lxml.py # lxml engine. markdown.py # Non-escaping string engine for Markdown output. - markdown/ # Markdown-specific components, config builder, and helpers. + markdown/ # Markdown-specific components, config builder, importer, and helpers. + importer.py # Markdown importer – parses Markdown into ContentState. utils/ module_loading.py # import_string() for dotted-path class resolution. ``` @@ -46,6 +47,19 @@ The core flow lives in `HTML.render()` and proceeds as follows: 5. **Wrapper resolution** – `wrapper_state.element_for()` resolves each block to a DOM element, managing nesting of wrapper elements (e.g. `