How can I convert one model attribute to another model attribute in ckEditor5?

Viewed 25

I'm setting up the Mentions plugin and want it to behave such that inserting a Mention (from the dropdown menu) inserts text with a link, and that link remains even if you edit the text.

By default, if you edit the text of the mention, ckEditor removes the mention/link.

My guess of the best way to do this is to convert the Mention attribute in the Model to a linkHref attribute. Is there a way to do this?

I'm aware of upcast and downcast conversion, but modifying these doesn't do what I want. It seems we really need a modification of a model.

(Commenting out lines 61 and 63 in [mentionediting.js][1] can actually prevent the undesired behavior, but this doesn't seem like the ideal solution to the problem.)

0 Answers
Related