Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

fix(editor): call parent parseMarkdown via this.parent for tiptap 3.31.4

Matt Robertsc8f93df97467
diff --git a/public/components/common/form/CustomImage.ts b/public/components/common/form/CustomImage.ts
index 6f21fa648..9ca98720f 100644
--- a/public/components/common/form/CustomImage.ts
+++ b/public/components/common/form/CustomImage.ts
@@ -19,14 +19,13 @@ type ImageToken = { href?: string; text?: string; title?: string | null }
// content that makes every later edit fail. Posts often end with such paragraphs (the server
// appends unreferenced attachments as "![](fider-image:<bkey>)"), so keep them as paragraphs.
// Use in place of StarterKit's paragraph.
-const parseParagraph = Paragraph.config.parseMarkdown
export const ImageParagraph = Paragraph.extend({
- parseMarkdown: (token, helpers) => {
+ parseMarkdown(token, helpers) {
const tokens = token.tokens || []
if (tokens.length === 1 && tokens[0].type === "image") {
return helpers.createNode("paragraph", undefined, helpers.parseInline(tokens))
}
- return parseParagraph ? parseParagraph(token, helpers) : helpers.createNode("paragraph", undefined, helpers.parseInline(tokens))
+ return this.parent ? this.parent(token, helpers) : helpers.createNode("paragraph", undefined, helpers.parseInline(tokens))
},
})