I'm trying to figure out some workaround, but it is a tough problem. Widget system uses the data-widget
attribute heavily and well... it should use data-cke-widget
as in all other cases, but for some historical reasons we kept data-widget
. Changing this decision now would be very risky, because we could break existing implementations, so I'm rather against this.
I was considering adding a configuration option which would stop widget system from upcasting elements based on data-widget attribute. It might be the best possible solution, but I'm not 100% certain about pasting. I think that in this case we first find wrapper (at least before 4.5.0) but it will need to be checked. In any case, this is not a solution that we'll quickly introduce.
Therefore, the workaround for now that I would propose would be to get rid of all data-widget
attributes from data before loading it to editor. Something like:
editor.setData( myData.replace( /data-widget=/g, 'data-mypersonalwidget=' ) );
And the opposite when getting data. This will work perfectly fine unless you need data-widget
attributes inside editor. But I think that it should not be a problem too.