From 06d674a7f6df021471ae8b8e1d11c4e8129f479a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 22 Oct 2021 11:18:54 +0200 Subject: [PATCH] docs: update content --- docs/api/nodes/mention.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/api/nodes/mention.md b/docs/api/nodes/mention.md index 8d52ce3d..bb610083 100644 --- a/docs/api/nodes/mention.md +++ b/docs/api/nodes/mention.md @@ -73,8 +73,27 @@ Mention.configure({ }) ``` -| renderLabel | `String` | `({ options, node }) => …` | Define how a mention label should be rendered. | -| suggestion | `Object` | `{ … }` | [Read more](/api/utilities/suggestion) | +### renderLabel +Define how a mention label should be rendered. + +```js +Mention.configure({ + renderLabel({ options, node }) { + return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}` + } +}) +``` + +### suggestion +[Read more](/api/utilities/suggestion) + +```js +Mention.configure({ + suggestion: { + // … + }, +}) +``` ## Source code [packages/extension-mention/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-mention/)