Repository navigation
fix(editor): keep task list content and indented code fences in markdown - #3616
Merged
Merged
Conversation
JammingBen
marked this pull request as ready for review
October 8, 2026 11:57
This was referenced Oct 8, 2026
AlexAndBear
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes content that gets lost or changed when a markdown file is opened in the editor and saved.
Fenced code blocks indented 1-3 spaces were dropped by tiptap. They are now parsed as code blocks.
Task lists (
markdownTaskList.ts): tiptap counts a tab as one character of indentation and cuts a fixed two characters from every line nested in a task item. That loses the first letter of lines indented by one space and the content of tab indented lines. Leading tabs are now expanded, and lines indented less than the item's content are moved to it. Tabs inside code blocks are kept.The workarounds can be removed once the referenced tiptap issues are fixed upstream (see linked issues in code).
Related Issue
How Has This Been Tested?
\`\`\` code \`\`\`- ais leftx paragraphbecomesparagraphx paragraphin the task itembandcare droppedbandcin the task itemhhin the task item`ode x`code/xin the task itemx cbecomescx cin the outer task itembis droppedbin the task item, with leading spaces (see known limitations)[ ] bb`js onst x = 1`jscode blockconst x = 1`ode`codein the first task itemKnown limitations
These task list inputs are still not kept as they are. They are no regressions,
mainhandles them the same or worse. They come from tiptap's task list tokenizer (ueberdosis/tiptap#7909) and are left for a follow-up:- [ ] a\n ```\n x\n ```\nloads as an empty code block, and saving drops thex.- [ ] a\n - [ ] b\nloadsbas the paragraph text[ ] binstead of a task item. The same happens tocin- [ ] a\n - [ ] b\n - [ ] c\n. In CommonMark these items are siblings of their parent.- [ ] a\n\tb\nloadsbas the paragraph textb, which is shown shifted to the right and saved asb. Onmainthe line is dropped. fix(editor): keep markdown lists and paragraphs stable across roundtrips #3614 fixes this, it strips the indentation of paragraph lines.