New to Kendo UI for AngularStart a free 30-day trial

Integrating ProseMirror Mentions Plugin in Editor

Environment

ProductProgress® Kendo UI® for Angular Editor

Description

How can I use @mentions and #hashtags inside Kendo UI for Editor component?

This Knowledge Base article also answers the following questions:

  • How to implement a custom plugin that allows mentions and hashtags in the Kendo UI for Angular Editor?
  • How to customize the appearance of the mentions dropdown list?
  • How to handle mentions and hashtags in the Editor content?

Solution

You can use the proseMirror-mentions plugin to provide a @mentions and #hashtags functionality for the Kendo UI for Angular Editor component. To implement the feature, you need to customize and integrate the built-in ProseMirror Schema and ProseMirror Plugins.

When you integrate the solution in your project, you would need to create a file named prosemirror-mentions.d.ts in the src folder of your project. The file should contain the following code:

typescript
declare module 'prosemirror-mentions';

This file is required to avoid TypeScript errors when you import the prosemirror-mentions plugin in your project.

Additionally, for proper dynamic positioning of the mentions list, you need to set the iframe property of the Editor to false. This ensures that the mentions dropdown can be positioned correctly relative to the editor content.

html
<kendo-editor [iframe]="false">
</kendo-editor>

The following example demonstrates how to integrate the proseMirror-mention plugin in Editor.

Change Theme
Theme
Loading ...
In this article
EnvironmentDescriptionSolutionSuggested Links
Not finding the help you need?
Contact Support