I need to develop a CKEditor 5 plugin which which when a list items has class x added, it will add class y to the wrapper or element.
So basically in the model I am expecting the following:-
<paragraph htmlLiAttributes="{classes:['x']}" listType="bulleted">item 1</paragraph>
Which all I need to do before the downcast happens is to alter it to the following
<paragraph htmlAttibutes="{classes:['y']}" htmlLiAttributes="{classes:['x']}" listType="bulleted">item 1</paragraph>
I have tried to add a dispatcher on the dataDowncast to the watch for the htmlAttibutes and then check for the htmlLiAttibutes to check for the presence of class x and then add class y to the htmlAttibutes.
I have tried create a dispatcher to monitor the htmlAttibutes, but this will only get called when the attribute exists.
I also tried watch the listType attribute but then I have not been able to find out a good method of checking the existing attributes without having to loop through all the items on the data.item and adding the additional attribute.
I feel at this stage I am too late.