From a975f11b4d7b15dd5821b35177f3f134eb257f60 Mon Sep 17 00:00:00 2001 From: Cesar Augusto Date: Mon, 29 Jul 2024 17:34:09 +0800 Subject: [PATCH] The editor shouldn't have content content text* --- examples/react/src/extensions/NProfileExtension.ts | 4 +++- src/__tests__/testExtensions/extensions/NProfileExtension.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/react/src/extensions/NProfileExtension.ts b/examples/react/src/extensions/NProfileExtension.ts index 2631012..ef02076 100644 --- a/examples/react/src/extensions/NProfileExtension.ts +++ b/examples/react/src/extensions/NProfileExtension.ts @@ -9,7 +9,9 @@ export const NProfileExtension = Node.create({ group: 'inline', - content: 'text*', + renderText(p) { + return p.node.textContent + }, renderHTML(p) { return ['span', { ...p.node.attrs }, 'mention'] diff --git a/src/__tests__/testExtensions/extensions/NProfileExtension.ts b/src/__tests__/testExtensions/extensions/NProfileExtension.ts index a80b5a4..8e850f1 100644 --- a/src/__tests__/testExtensions/extensions/NProfileExtension.ts +++ b/src/__tests__/testExtensions/extensions/NProfileExtension.ts @@ -9,7 +9,7 @@ export const NProfileExtension = Node.create({ group: 'inline', - content: 'text*', + content: 'text?', renderHTML(p) { return ['span', p.node.attrs, '@']