Skip to content

fix(editor): keep markdown paragraph text from turning into block syntax - #3618

Merged
JammingBen merged 1 commit into
fix/tiptap-md-task-listsfrom
fix/tiptap-md-paragraphs
Oct 13, 2026
Merged

JammingBen merged 1 commit into
fix/tiptap-md-task-listsfrom
fix/tiptap-md-paragraphs

Conversation

@JammingBen

@JammingBen JammingBen commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #3616.

Escape block syntax at the start of paragraph lines. Tiptap only escapes inline syntax, so paragraph text like "1. May", "- foo" or "# foo" is saved without its backslash and comes back as a list or heading on the next load. List markers (-, +, 1., 1), letter and roman markers like A. or I.), ATX headings and setext underlines are escaped now.

  • After a soft line break only syntax that can interrupt a paragraph is escaped, so "2. Liga" or "Mr. Smith" further down stay as they are.
  • In list items every line is escaped like a first line, since continuation lines are written unindented.
  • GitHub alert markers (> [!NOTE]) and table cells stay unescaped.

Drop the indentation of paragraph lines. Markdown ignores it, but marked keeps it in the text, so the editor shows the lines shifted to the right and saves the spaces back.

The escaping can be removed once ueberdosis/tiptap#8134 is fixed upstream (see FIXME in code).

Related Issue

How Has This Been Tested?

mkdir md-paragraphs && cd md-paragraphs
printf -- '1\\. May\n' > 01-ordered-marker.md
printf -- '\\- not a list\n' > 02-bullet-marker.md
printf -- '\\+ not a list\n' > 03-plus-marker.md
printf -- '\\# not a heading\n' > 04-heading.md
printf -- 'A\\. Müller\n' > 05-letter-marker.md
printf -- 'I\\. Introduction\n' > 06-roman-marker.md
printf -- 'Title\n\\===\n' > 07-setext-underline.md
printf -- 'Hi\nMr. Smith\n2. Liga\n1\\. one\n' > 08-soft-line-breaks.md
printf -- '- a\n  2\\. b\n  Dr\\. Smith\n' > 09-list-item-lines.md
printf -- '> [!NOTE]\n> hint\n' > 10-alert.md
printf -- 'a\n  b\n' > 11-indented-line.md
printf -- '- [ ] a\n\tb\n' > 12-task-tab-line.md
File main this PR
01 1. May, an ordered list on the next load 1\. May
02 - not a list, a bullet list \- not a list
03 + not a list, a bullet list, saved as - not a list next time \+ not a list
04 # not a heading, a heading \# not a heading
05 A. Müller, a letter list A\. Müller
06 I. Introduction, a roman list I\. Introduction
07 Title\n===, saved as the heading # Title next time Title\n\===
08 1. one becomes a list after the second save 1\. one, the other lines stay as they are
09 - a\n2. b\nDr. Smith, saved as - a\n\n2. b\n3. Smith next time, "Dr" is lost - a\n2\. b\nDr\. Smith
10 > \[!NOTE\], the alert becomes text > [!NOTE]
11 Shown and saved as a\n b a\nb
12 b is dropped (with #3616: shown as b and saved indented) b in the task item

@JammingBen
JammingBen force-pushed the fix/tiptap-md-paragraphs branch from de40e94 to fe1e39b Compare October 8, 2026 12:11
@JammingBen
JammingBen marked this pull request as ready for review October 8, 2026 12:20
@JammingBen
JammingBen merged commit 8a48993 into main Oct 13, 2026
31 checks passed
@JammingBen
JammingBen deleted the fix/tiptap-md-paragraphs 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