Skip to content

fix(editor): keep markdown lists and paragraphs stable across roundtrips - #3614

Merged
JammingBen merged 1 commit into
fix/tiptap-md-paragraphsfrom
fix/tiptap-md-issues
Oct 13, 2026
Merged

JammingBen merged 1 commit into
fix/tiptap-md-paragraphsfrom
fix/tiptap-md-issues

Conversation

@JammingBen

@JammingBen JammingBen commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #3616 and #3618.

  • Leave numeric ordered lists to marked, so items indented less than the first one are no longer dropped. Letter and roman lists stay with tiptap.
  • Start a list at an empty first item followed by whitespace (- , 1. ), which marked reads as paragraph text.
  • Keep task syntax in ordered lists (1. [ ] task) as text.
  • Make sure every list item starts with a paragraph, so empty sub items and their parents survive. A list item starting with another block, e.g. an ATX heading or a code block, gets an empty paragraph before it.
  • Save empty list items as a bare marker (-, 1.) where possible, " " only where a bare marker would not parse back as an empty item.
  • Keep inline formatting of text that follows a block inside a list item, and keep image-only list items.

Many of these workarounds can be removed once the referenced tiptap issues are fixed upstream (see linked issues in code).

Issue

fixes parts of #3583

Known limitations

  • Setext headings (Title + ===/--- underline) as the first block of a list item are kept as paragraph text, not as a heading. Before this change they produced an invalid document. ATX headings (# Title) stay headings.
  • An empty list item directly after a paragraph line (foo\n1. ) starts a list, while CommonMark treats it as paragraph text.
  • Changing the delimiter within a numeric list (1) a + 2. b) splits it into two lists, as in CommonMark. Both are saved with ., so they merge back into one list on the next load (Text editor changes list structure of some markdown documents on save #3622).
  • A single - below the first line of a list item (- Title + -) becomes an empty sub item instead of a setext heading underline. This keeps lists saved by earlier versions (- Parent + -) intact.
  • Content under a numeric list item must be indented to the item's content column (3 spaces for 1. ), as in CommonMark. Content indented with 2 spaces, as saved by OpenCloud v7.x, is moved out of the list (Text editor changes list structure of some markdown documents on save #3622).

@JammingBen JammingBen self-assigned this Oct 8, 2026
@JammingBen JammingBen changed the title fix(web-pkg): keep markdown lists and paragraphs stable across roundtrips fix(editor): keep markdown lists and paragraphs stable across roundtrips Oct 8, 2026
@JammingBen
JammingBen force-pushed the fix/tiptap-md-issues branch from f67f8c9 to c3ac575 Compare October 8, 2026 11:09
@JammingBen
JammingBen changed the base branch from main to fix/tiptap-md-task-lists October 8, 2026 11:10
@JammingBen
JammingBen added this pull request to stack #3617 October 8, 2026 11:10
@JammingBen
JammingBen force-pushed the fix/tiptap-md-issues branch from c3ac575 to 8fc226b Compare October 8, 2026 11:38
@JammingBen
JammingBen force-pushed the fix/tiptap-md-issues branch from 8fc226b to 9382f7d Compare October 8, 2026 11:50
@JammingBen
JammingBen removed this pull request from stack #3617 October 8, 2026 11:52
@JammingBen
JammingBen changed the base branch from fix/tiptap-md-task-lists to fix/tiptap-md-paragraphs October 8, 2026 11:54
@JammingBen
JammingBen added this pull request to stack #3619 October 8, 2026 11:55
@JammingBen
JammingBen force-pushed the fix/tiptap-md-issues branch from 9382f7d to fa92675 Compare October 8, 2026 12:14
@JammingBen
JammingBen merged commit 8a48993 into main Oct 13, 2026
31 checks passed
@JammingBen
JammingBen deleted the fix/tiptap-md-issues branch October 13, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants