mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-24 18:36:58 -06:00
Pasting a table into its own cell doubled the nesting each time, and about a dozen pastes built a document that overflowed the stack when it was saved as JSON, copied, closed or replaced by a new one. Tables now nest at most 24 deep (wordcraft_doc::table::MAX_TABLE_DEPTH), the depth the .docx reader and writer already keep. Document::insert_fragment turns a table that would go deeper into its paragraphs, in document order; Document::insert_block refuses it, so Insert > Table in a cell 24 tables deep fails with a message and leaves the document as it was. The depth is measured without recursion. Word has no limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>