From d8a8549c8a57dfe8f11d572809f24b9c4f3a7071 Mon Sep 17 00:00:00 2001 From: Bohan Jiang <52446949+Bohan-J@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:23:13 +0800 Subject: [PATCH] fix(editor): use correct getMarkdown API for @tiptap/markdown (#217) The migration from tiptap-markdown to @tiptap/markdown in 38e92040 broke comment creation. The old package stored getMarkdown() on editor.storage.markdown, but the official @tiptap/markdown extension adds it directly to the editor instance (editor.getMarkdown()). This caused getEditorMarkdown() to always return "", making the submit button permanently disabled and preventing any comments. Also fix stale submitting ref in useIssueTimeline dependency array. --- apps/web/components/common/rich-text-editor.tsx | 4 ++-- apps/web/features/issues/hooks/use-issue-timeline.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/components/common/rich-text-editor.tsx b/apps/web/components/common/rich-text-editor.tsx index 447c4278..8614471b 100644 --- a/apps/web/components/common/rich-text-editor.tsx +++ b/apps/web/components/common/rich-text-editor.tsx @@ -160,10 +160,10 @@ const RichTextEditor = forwardRef( const onUpdateRef = useRef(onUpdate); const onSubmitRef = useRef(onSubmit); - // Helper to get markdown from tiptap-markdown storage + // Helper to get markdown from @tiptap/markdown extension // eslint-disable-next-line @typescript-eslint/no-explicit-any const getEditorMarkdown = (ed: any): string => - ed?.storage?.markdown?.getMarkdown?.() ?? ""; + ed?.getMarkdown?.() ?? ""; // Keep refs in sync without recreating editor onUpdateRef.current = onUpdate; diff --git a/apps/web/features/issues/hooks/use-issue-timeline.ts b/apps/web/features/issues/hooks/use-issue-timeline.ts index 98530d9a..de211e0e 100644 --- a/apps/web/features/issues/hooks/use-issue-timeline.ts +++ b/apps/web/features/issues/hooks/use-issue-timeline.ts @@ -202,7 +202,7 @@ export function useIssueTimeline(issueId: string, userId?: string) { setSubmitting(false); } }, - [issueId, userId, submitting], + [issueId, userId], ); const submitReply = useCallback(