mdx-editor / mdx-editor/editor

Allow `markdownShortcutsPlugin` to insert nodes on newline without pressing SPACE (or document how to)

Open
#716 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.7k
Forks
307
Avg merge
14h 22m
Merged PRs (30d)
5

Description

I've found this discussion, but I found no later development.

https://github.com/mdx-editor/editor/issues/290#issuecomment-2451184375

It could be a simple flag: markdownShortcutsPlugin({insertNodesOnEnter: true}).

I tried implementing it myself by copying the plugin, but with no success, as I don't know why lexical is not picking the regexp up correctly for markdown transformers when pressing Enter, but still requires a space to be inserted.

An example can be seen in https://github.com/mdx-editor/editor/pull/714 when inserting a thematic break with ---.

(PS. I'd be glad to keep in touch. Feel free to send me an email!)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review markdownShortcutsPlugin and the behavior described in PR 714, focusing on the thematic-break example and Lexical's markdown transformer handling on Enter. Done means the plugin either supports an explicit insertNodesOnEnter option or documents a working way to insert nodes on newline without SPACE, with the stated example working.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, react, typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.