Skip to content

Commit

Permalink
apply text align types to selected extensions only
Browse files Browse the repository at this point in the history
  • Loading branch information
formfcw committed Nov 5, 2024
1 parent 0aea3df commit 9947e50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/interface/tools/text-align/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export default defineTool({
name: customMessages.tools.text_align,
icon: "format_align_left",
extension: [
TextAlign.configure({ types: ["heading", "paragraph", "codeBlock"] }),
(selection) =>
TextAlign.configure({
types: selection?.filter((extension) =>
["heading", "paragraph", "codeBlock"].includes(extension)
),
}),
],
toolbarButton: ToolButton,
action: (editor: Editor, alignment: string) => {
Expand Down

0 comments on commit 9947e50

Please sign in to comment.