fix: headings 4, 5 and 6 triggering heading 3 (#5206)

This commit is contained in:
Aaryan Khandelwal 2024-07-23 15:12:21 +05:30 committed by GitHub
parent 7b6a2343cb
commit c6cdc12165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,6 +32,9 @@ import {
toggleHeadingOne, toggleHeadingOne,
toggleHeadingTwo, toggleHeadingTwo,
toggleHeadingThree, toggleHeadingThree,
toggleHeadingFour,
toggleHeadingFive,
toggleHeadingSix,
} from "@/helpers/editor-commands"; } from "@/helpers/editor-commands";
// types // types
import { CommandProps, ISlashCommandItem, UploadImage } from "@/types"; import { CommandProps, ISlashCommandItem, UploadImage } from "@/types";
@ -139,7 +142,7 @@ const getSuggestionItems =
searchTerms: ["subtitle", "small"], searchTerms: ["subtitle", "small"],
icon: <Heading4 className="size-3.5" />, icon: <Heading4 className="size-3.5" />,
command: ({ editor, range }: CommandProps) => { command: ({ editor, range }: CommandProps) => {
toggleHeadingThree(editor, range); toggleHeadingFour(editor, range);
}, },
}, },
{ {
@ -149,7 +152,7 @@ const getSuggestionItems =
searchTerms: ["subtitle", "small"], searchTerms: ["subtitle", "small"],
icon: <Heading5 className="size-3.5" />, icon: <Heading5 className="size-3.5" />,
command: ({ editor, range }: CommandProps) => { command: ({ editor, range }: CommandProps) => {
toggleHeadingThree(editor, range); toggleHeadingFive(editor, range);
}, },
}, },
{ {
@ -159,7 +162,7 @@ const getSuggestionItems =
searchTerms: ["subtitle", "small"], searchTerms: ["subtitle", "small"],
icon: <Heading6 className="size-3.5" />, icon: <Heading6 className="size-3.5" />,
command: ({ editor, range }: CommandProps) => { command: ({ editor, range }: CommandProps) => {
toggleHeadingThree(editor, range); toggleHeadingSix(editor, range);
}, },
}, },
{ {