Repository navigation
Description
Description
Pressing forward Delete at the end of the bottom-right table cell, when at least two blocks follow the table, opens the "Unexpected renderer process error" dialog. Every later keystroke, in any cell, opens it again. The edits appear on screen, but the document is never marked modified: File > Save writes the original file, and everything typed after the Delete is lost. With only one block after the table the same Delete works.
Steps to Reproduce
- Create
table.mdwith exactly this content:| x | y | | - | - | | 1 | 2 | p q
- Open it in MarkText.
- Click just to the right of the
2in the bottom-right cell, so the caret is at the end of the cell. - Press forward Delete (⌦ on a full keyboard, fn+delete on a Mac laptop). Backspace does not trigger it.
- Type
z. - Click after
xin the header cell and typew. - Choose File > Save, close the file and open it again. Check the header cell: it shows
x, notxw.
Table inside a list item (steps 3–5 the same):
- a
| x | y |
| - | - |
| 1 | 2 |
- b
- cFor comparison, remove the last two lines (the blank line and q) from table.md: the same steps then work without errors, and the file saves | xw | y | / | 1 | 2zp |.
Expected Behavior
No error, as with a single paragraph after the table: p is merged into the cell (2p, then 2zp) and q stays a separate paragraph below the table. The document is marked modified, and the saved file matches the screen (| xw | y |, | 1 | 2zp |, then q). In the list variant, c stays a list item outside the table.
Actual Behavior
- The Delete opens the "Unexpected renderer process error" dialog with
Cannot use numerical key for object container. Typingz, and typingwin the header cell, each open it again. Clicks do not. - The cell shows
2p, then2zp.qis drawn immediately right of the last row, on the table's right border. - The unsaved marker never appears in the title bar.
- File > Save leaves the file byte-for-byte unchanged. After reopening, the original table,
pandqare shown, and the header cell readsx. - List variant: the cell shows
2b, then2zb, andcwith its bullet is drawn to the right of the row. Same dialog on every keystroke, no unsaved marker, file unchanged after Save.
Screenshots / Logs
Error: Cannot use numerical key for object container
at assert (index-_m8tBt4l.js:146967:24)
at insertChildMut (index-_m8tBt4l.js:147006:99)
at drop2 (index-_m8tBt4l.js:147111:127)
at drop2 (index-_m8tBt4l.js:147108:27)
at drop2 (index-_m8tBt4l.js:147108:27)
... JSONState._apply ← JSONState._flushOperationCache
Operating System
macOS
MarkText Version
0.20.0-rc.3 (also reproduced on the current develop branch)
OS Version
macOS 27.0 (arm64)
Reproducibility
- I can reliably reproduce this issue
Related
- Unexpected error with message Cannot use numerical key for object container #4944 / Unexpected error with message Cannot use numerical key for object container #4989: same error message from a different trigger (paragraph commands inside a table or code block, fixed by fix(muya): run paragraph commands on the whole table or code block (#4944) #5358). This one still happens on develop after that fix.
- [Bug] After one failed edit, every later edit throws and is not saved until the file is reopened #5373: the general follow-on symptom (after one failed edit, every later edit throws and is not saved); this issue is one specific trigger. Deleting an item creates double itemization bullets in front of the next item #1845 / fix(muya): keep a nested sublist when forward-deleting an empty list item (#1845) #4725: the forward-Delete change that moves the blocks following a merged paragraph (see below).
Possible cause (unverified): Format.deleteHandler in packages/muya/src/block/base/format.ts moves the blocks after the merged paragraph next to this.parent, assuming that parent is a paragraph (#4725). In a table cell the parent is the cell, so q (or the - c sub-list) is inserted into the table row, the JSON state operation fails, and the failed operation stays queued so every later flush throws.
Activity
fix(muya): keep blocks after a paragraph merged into a table cell out…
Merge upstream/develop (marktext/marktext) into local develop