evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Design converters that round-trip user mention data between view markup and model attributes while preserving metadata and display text.
<a class="mention" data-marker="@" data-id="chris" data-name="Chris Holm" data-href="/users/chris" data-avatar="/img/chris.png"> produces a model mention attribute with a marker-prefixed id, generated uid, preserved metadata (name, href, avatar), and uses the element text as display text when no explicit name is provided. @test{ name: "Sara Li", href: "/profiles/sara", avatar: "/avatars/sara.png" }, the downcast converter renders an <a> element with mention styling, data attributes mirroring the metadata, and link text set to the display name. @testimport type { Editor } from '@ckeditor/ckeditor5-core';
export interface UserMentionData {
id: string;
name: string;
href?: string;
avatar?: string;
text?: string;
[key: string]: unknown;
}
/**
* Registers custom mention converters that upcast annotated links into mention attributes
* and downcast mention attributes back into annotated links.
*/
export function registerUserMentionConverters(editor: Editor): void;
/**
* Builds a mention attribute object with uid, marker-prefixed id, display text, and metadata
* that can be attached before insertion.
*/
export function buildUserMentionAttribute(data: UserMentionData): Record<string, unknown>;Provides mention attribute helpers and converter utilities.