Bug Report: Confluence Editor Crash When Pasting Markdown Table with Leading Spaces and Dashes
Summary
Pasting a markdown table with leading spaces and standalone - cell values causes the Confluence editor to freeze (Firefox) or crash with out-of-memory (Chrome).
Environment
- Product: Confluence Cloud
- Browsers: Chrome (crashes), Firefox (freezes, UI unresponsive)
- Editor: New editor (ProseMirror-based)
| A |
|---|
| - |
| - |
Requirements:
- Leading space before
| on each line - Two or more rows with standalone
- as cell value
Steps to Reproduce
- Open any Confluence page in edit mode
- Copy the text above (preserve leading spaces)
- Paste into editor (Ctrl+V) using markdown
- Observe freeze/crash
Observed Behavior
- Chrome: Memory spikes from ~700MB to 6.3GB+, tab crashes with "Aw, Snap!" error (Error code: Out of Memory)

- Firefox: UI freezes, buttons unresponsive, typing still works
Potential Root Cause
The list parser enters an infinite while loop:
- Parser sees
- as a bullet list marker - Creates
list_item_open/list_item_close tokens each iteration state.line never advances (stuck at 2)- Loop condition
while (nextLine < endLine) never exits - Token array grows indefinitely: 58 → 60 → 62 → ...
Key debugger observations:
nextLine: 2 (never changes)
endLine: 3
state.line: 2 (never advances)
state.lineMax: 1 (incorrect - should be 4)
state.tokens.length: grows by 2 each iteration
Stack trace (constant depth = loop, not recursion):
list.js:305
parser_block.js:80
table.js:228
parser_block.js:80
parser_block.js:124
handlePaste (main.ts:166)
What Works vs What Crashes
Crashes:
| A |
|---|
| - |
| - |
Works:
| A |
|---|
| - |
| - |
(no leading space)
| A |
|---|
| - |
(only one dash row)
| A |
|---|
| N/A |
| N/A |
(no standalone dashes)
Note
Vanilla markdown-it (tested v12+) parses the same input correctly. Bug is specific to Confluence's markdown-it integration.
Workarounds
- Remove leading spaces before pasting
- Replace
- with N/A or — - Paste as plain text (Ctrl+Shift+V)
Impact
- Severity: High (browser crash/freeze)
- Data Loss: Unsaved changes after last auto-save are lost
Keywords
Confluence paste markdown table crash, Aw Snap Out of Memory, editor freeze hang, list parser infinite loop, leading space dash cell, OOM browser crash, ProseMirror markdown-it bug