Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] allowedHeadingLevels not working with markdown shortcuts #559

Open
gaki2 opened this issue Jul 28, 2024 · 1 comment
Open

[BUG] allowedHeadingLevels not working with markdown shortcuts #559

gaki2 opened this issue Jul 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gaki2
Copy link

gaki2 commented Jul 28, 2024

If you want to ask for support or request features, sponsor the project and contact me over email.

  • [o] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • [o] I have read the documentation and cannot find an answer.

Describe the bug

After setting allowedHeadingLevels [1,2], but ### + spacebar shortcut makes h3 tag. also h4, h5, h6.

export default function InitializedMDXEditor({
  editorRef,
  ...props
}: { editorRef: ForwardedRef<MDXEditorMethods> | null } & MDXEditorProps) {
  return (
    <MDXEditor
      plugins={[
        headingsPlugin({
          allowedHeadingLevels: [1, 2],
        }),
        markdownShortcutPlugin(),
      ]}
      {...props}
      ref={editorRef}
    />
  );
}

Reproduction
Start from https://codesandbox.io/p/sandbox/mdx-editor-base-q8s7zr?file=/src/App.tsx to reproduce the problem so that I can observe the issue on my side and make sure that the fix reliably addresses it.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I set allowedHeadingLevels = [1,2] but ### or #### or ##### or ###### still working.

Screenshots
If applicable, add screenshots to help explain your problem.

Screen.Recording.2024-07-28.at.4.21.02.PM.mov

Desktop (please complete the following information):

  • MacOs, tauri
@gaki2 gaki2 added the bug Something isn't working label Jul 28, 2024
@petyosi
Copy link
Contributor

petyosi commented Jul 28, 2024

Agreed. One more point towards moving the markdown shortcuts from lexical into the mdxeditor code. Misfortunate.

@petyosi petyosi changed the title [BUG] allowedHeadingLevels not working. [BUG] allowedHeadingLevels not working with markdown shortcuts Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants