![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@tiptap/extension-mention
Advanced tools
@tiptap/extension-mention is an extension for the Tiptap editor that allows you to add mention functionality to your text editor. This can be used to mention users, tags, or any other entities within the text.
Basic Mention Setup
This code sets up a basic mention extension with custom HTML attributes and a suggestion list. The suggestion list filters items based on the query.
import { Mention } from '@tiptap/extension-mention';
const mention = Mention.configure({
HTMLAttributes: {
class: 'mention',
},
suggestion: {
items: (query) => {
return [
{ id: 1, label: 'John Doe' },
{ id: 2, label: 'Jane Doe' },
].filter(item => item.label.toLowerCase().includes(query.toLowerCase()));
},
render: () => {
// Custom rendering logic
},
},
});
Custom Mention Rendering
This code configures the mention extension to render mentions with a custom label format, prefixing the label with '@'.
import { Mention } from '@tiptap/extension-mention';
const mention = Mention.configure({
renderLabel({ options, node }) {
return `@${node.attrs.label}`;
},
});
Mention with Custom Attributes
This code configures the mention extension to include custom HTML attributes, such as a custom class and a data attribute for the mention ID.
import { Mention } from '@tiptap/extension-mention';
const mention = Mention.configure({
HTMLAttributes: {
class: 'custom-mention',
'data-mention-id': (node) => node.attrs.id,
},
});
quill-mention is a module for the Quill editor that provides similar mention functionality. It allows you to mention users, tags, or other entities within the text. Compared to @tiptap/extension-mention, quill-mention is designed specifically for the Quill editor and offers a different API and configuration options.
draft-js-mention-plugin is a plugin for the Draft.js editor that adds mention functionality. It allows you to mention users, tags, or other entities within the text. Compared to @tiptap/extension-mention, draft-js-mention-plugin is designed specifically for the Draft.js editor and offers a different API and configuration options.
slate-plugins is a collection of plugins for the Slate editor, including a mention plugin. It allows you to mention users, tags, or other entities within the text. Compared to @tiptap/extension-mention, slate-plugins is designed specifically for the Slate editor and offers a different API and configuration options.
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
mention extension for tiptap
The npm package @tiptap/extension-mention receives a total of 200,064 weekly downloads. As such, @tiptap/extension-mention popularity was classified as popular.
We found that @tiptap/extension-mention demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.