Remove list format and convert to heading when Header button pressed on list item#62
Draft
MartinDejmal with Copilot wants to merge 2 commits into
Draft
Remove list format and convert to heading when Header button pressed on list item#62MartinDejmal with Copilot wants to merge 2 commits into
MartinDejmal with Copilot wants to merge 2 commits into
Conversation
…on list item Agent-Logs-Url: https://github.com/MartinDejmal/mdedit/sessions/f86e3fe7-3aaf-41ca-94ee-572e15ac2d5b Co-authored-by: MartinDejmal <18679101+MartinDejmal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix header button behavior to remove list format and set to heading
Remove list format and convert to heading when Header button pressed on list item
May 8, 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.
Pressing the Heading button while the cursor was inside a list item did nothing useful — headings can't exist inside list nodes in Tiptap, so the command silently failed.
Changes
editorCommands.ts—cycleHeading()Added list-type detection before the normal heading cycle. When the cursor is in a list item, the list is unwrapped first, then H1 is applied:
bulletList/orderedList: usestoggleBulletList()/toggleOrderedList()to lift the item to a paragraph, then chainssetHeading({ level: 1 })taskList: usesliftListItem("taskItem")directly (no built-in toggle command for custom task list nodes), then chainssetHeading({ level: 1 })Toolbar.tsx— Heading button tooltipAdded a
"Heading: List → H1"tooltip state for when the cursor is inside any list, consistent with the existing H1→H2→H3→Normal tooltip progression.