-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[WIKI-569] regression: parser kit extensions mismatch #7885
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,6 @@ | ||||||||||||||||||||||||||||||||||||
| import TaskItem from "@tiptap/extension-task-item"; | ||||||||||||||||||||||||||||||||||||
| import TaskList from "@tiptap/extension-task-list"; | ||||||||||||||||||||||||||||||||||||
| import { TextStyle } from "@tiptap/extension-text-style"; | ||||||||||||||||||||||||||||||||||||
| import StarterKit from "@tiptap/starter-kit"; | ||||||||||||||||||||||||||||||||||||
| // helpers | ||||||||||||||||||||||||||||||||||||
| import { isValidHttpUrl } from "@/helpers/common"; | ||||||||||||||||||||||||||||||||||||
| // plane editor imports | ||||||||||||||||||||||||||||||||||||
| import { CoreEditorAdditionalExtensionsWithoutProps } from "@/plane-editor/extensions/core/without-props"; | ||||||||||||||||||||||||||||||||||||
| // extensions | ||||||||||||||||||||||||||||||||||||
|
|
@@ -18,61 +15,19 @@ import { CustomHorizontalRule } from "./horizontal-rule"; | |||||||||||||||||||||||||||||||||||
| import { ImageExtensionConfig } from "./image"; | ||||||||||||||||||||||||||||||||||||
| import { CustomMentionExtensionConfig } from "./mentions/extension-config"; | ||||||||||||||||||||||||||||||||||||
| import { CustomQuoteExtension } from "./quote"; | ||||||||||||||||||||||||||||||||||||
| import { CustomStarterKitExtension } from "./starter-kit"; | ||||||||||||||||||||||||||||||||||||
| import { TableHeader, TableCell, TableRow, Table } from "./table"; | ||||||||||||||||||||||||||||||||||||
| import { CustomTextAlignExtension } from "./text-align"; | ||||||||||||||||||||||||||||||||||||
| import { WorkItemEmbedExtensionConfig } from "./work-item-embed/extension-config"; | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| export const CoreEditorExtensionsWithoutProps = [ | ||||||||||||||||||||||||||||||||||||
| StarterKit.configure({ | ||||||||||||||||||||||||||||||||||||
| bulletList: { | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "list-disc pl-7 space-y-[--list-spacing-y]", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| orderedList: { | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "list-decimal pl-7 space-y-[--list-spacing-y]", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| listItem: { | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "not-prose space-y-2", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| code: false, | ||||||||||||||||||||||||||||||||||||
| codeBlock: false, | ||||||||||||||||||||||||||||||||||||
| horizontalRule: false, | ||||||||||||||||||||||||||||||||||||
| blockquote: false, | ||||||||||||||||||||||||||||||||||||
| paragraph: { | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "editor-paragraph-block", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| heading: { | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "editor-heading-block", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| dropcursor: false, | ||||||||||||||||||||||||||||||||||||
| CustomStarterKitExtension({ | ||||||||||||||||||||||||||||||||||||
| enableHistory: true, | ||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||
| EmojiExtension, | ||||||||||||||||||||||||||||||||||||
| CustomQuoteExtension, | ||||||||||||||||||||||||||||||||||||
| CustomHorizontalRule.configure({ | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: "py-4 border-custom-border-400", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||
| CustomLinkExtension.configure({ | ||||||||||||||||||||||||||||||||||||
| openOnClick: true, | ||||||||||||||||||||||||||||||||||||
| autolink: true, | ||||||||||||||||||||||||||||||||||||
| linkOnPaste: true, | ||||||||||||||||||||||||||||||||||||
| protocols: ["http", "https"], | ||||||||||||||||||||||||||||||||||||
| validate: (url: string) => isValidHttpUrl(url).isValid, | ||||||||||||||||||||||||||||||||||||
| HTMLAttributes: { | ||||||||||||||||||||||||||||||||||||
| class: | ||||||||||||||||||||||||||||||||||||
| "text-custom-primary-300 underline underline-offset-[3px] hover:text-custom-primary-500 transition-colors cursor-pointer", | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||
| CustomHorizontalRule, | ||||||||||||||||||||||||||||||||||||
| CustomLinkExtension, | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+29
to
+30
|
||||||||||||||||||||||||||||||||||||
| CustomHorizontalRule, | |
| CustomLinkExtension, | |
| CustomHorizontalRule.configure({ | |
| HTMLAttributes: { | |
| class: "my-4 border-t border-gray-300", // Example, replace with your actual class | |
| }, | |
| }), | |
| CustomLinkExtension.configure({ | |
| HTMLAttributes: { | |
| class: "text-blue-600 underline", // Example, replace with your actual class | |
| }, | |
| validate: href => { | |
| // Example validation: allow only http, https, mailto, and tel | |
| return /^(https?:\/\/|mailto:|tel:)/.test(href); | |
| }, | |
| protocols: ['http', 'https', 'mailto', 'tel'], | |
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CustomStarterKitExtension import is added but the corresponding file './starter-kit' may not exist or may not export this function. This could cause a runtime error if the module is not properly implemented.