upcase attributeToAttribute / downcast attributeToElement #12157
Labels
resolution:expired
This issue was closed due to lack of feedback.
type:task
This issue reports a chore (non-production change) and other types of "todos".
Provide a description of the task
I am trying to upgrade the ckeditor5-build-classic and my custom plugins from version 21.0.0 to 34.2.0. The following plugin code works fine in 21.0.0. The plugin allows the editor to keep two specific classes ['brokenlink', 'redirectlink'] on a ahref element to highlight the link is working or not.
The documentation on the API change for the view isn't very clear (to me) how to update the code for version 34.2.0.
Based on this link I should update:
view: (attributeValue, writer) => writer.createAttributeElement('a', { class: attributeValue }, { priority: 5 }),
to
view: (attributeValue, { writer }) => { return writer.createAttributeElement('a', { class: attributeValue }, { priority: 5 }) },
But that doesn't seem to work. There isn't a similar example in the documentation with a createAttributeElement for the view. As far as I was able to find no other changes are needed to update to version 34.2? Is that correct?
The documentation shows a "classes" property so it might be that "class" is a reserved word now that can't be used in the same was as in 21.0.0? I've tried multiple variations of code that I've found online, but none of them seem to work. What am I missing or what is missing in the documentation?
What do I need to change to update make this plugin working for version 34.2.0?
Second question:
As an addition to this plugin I would also like to remove the class when the url is updated in the editor and the value is different than it was when the editor loaded. Any documentation on how to do that?
📃 Other details
The text was updated successfully, but these errors were encountered: