Static
Readonly
pluginStatic
Readonly
requiresRegister an attribute as being bound to links.
This method automatically registers the corresponding up- and downcast configuration and extends the model schema.
It also registers the attribute for clean-up, when a link gets
removed (via LinkCleanup
plugin).
configuration of the link attribute
This generic plugin lets you register attributes, that are meant to be bound to links only. It will take care to register corresponding up- and downcast, as well as listening to selection changes, similar as CKEditor's link feature does.
To benefit from CKEditor's link feature, it is highly recommended that all model attributes start with
link
in their names.Configuration API
To register attributes to handle as being part of links, you may call
registerAttribute
. To ease this process, a utility methodgetLinkAttributes
exists, that may be invoked like this:CKEditor Configuration
As an alternative to configuring these attributes via API, you may also define corresponding attributes as part of the CKEditor Link Feature configuration – with an extended section
attributes
:Declaring this as a constant is recommended to get IDE support regarding the available fields and valid values. You will note that the type of the field
model
requires, that the value starts withlink
. This automatically triggers some behavior in the Link Plugin.Configuration as part of the CKEditor 5 Configuration section is highly recommended, when it is about attributes that are not yet handled by any dedicated plugin, that provides editing features for that attribute. If a plugin gets added, that handles the corresponding attribute, the configuration needs to be adapted accordingly.
While this plugin does not depend on
LinkEditing
explicitly, it is best used withLinkEditing
to be available. Otherwise, some clean-up tasks we implicitly rely on (like for all model attributes prefixed withlink
) won't work.