From ee6a6ecf3f9bea83476cbe49aea4628ccf3e5584 Mon Sep 17 00:00:00 2001 From: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com> Date: Thu, 10 Aug 2023 03:31:38 +0530 Subject: [PATCH] fixing node ts error for Horizontal Rule --- apps/app/components/tiptap/extensions/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/app/components/tiptap/extensions/index.tsx b/apps/app/components/tiptap/extensions/index.tsx index 14d7106eb..5af141586 100644 --- a/apps/app/components/tiptap/extensions/index.tsx +++ b/apps/app/components/tiptap/extensions/index.tsx @@ -14,6 +14,7 @@ import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight"; import { lowlight } from 'lowlight/lib/core' import SlashCommand from "../slash-command"; import { InputRule } from "@tiptap/core"; +import { Node as ProseMirrorNode } from '@tiptap/pm/model'; import ts from 'highlight.js/lib/languages/typescript' @@ -80,8 +81,8 @@ export const TiptapExtensions = [ const { tr } = state; const start = range.from; const end = range.to; - - tr.insert(start - 1, this.type.create(attributes)).delete( + const node = this.type.create(attributes) as unknown as ProseMirrorNode; + tr.insert(start - 1, node).delete( tr.mapping.map(start), tr.mapping.map(end), );