-
Notifications
You must be signed in to change notification settings - Fork 40
Removed the "model.Writer#setTextData()" method #1394
Conversation
You didn't check whether this method is used somewhere... and it is. @scofalik, I checked that we can't simply remove this bit: https://github.com/ckeditor/ckeditor5-list/blob/d2023267caa88eb383b1fab773e137c233cf5b8d/src/converters.js#L455-L462 Do you think that we could use |
BTW, it seems that we can also fix https://github.com/ckeditor/ckeditor5-list/issues/101 easily because it should also have access to the writer. |
So the |
May be true. We both got a bit confused when discussing this in #1363 with @pjasiun. Anyway, the |
After removing Remove the child of |
Model writer offers a simple A simpler solution would indeed be replacing an entire text node, but then we need to take care of its attributes. That's a bit worse to me. |
Everything sounds good but the write instance is the instance of the model but the |
Edit: To be honest, just removing and adding a text node might probably by simpler than evaluating a range and passing to the writer. Why are you worried about attributes? You are processing child-after-child, so every child has different attributes. Edit: Now I got what you wrote @pomek. This is weird. Let me look at this. |
WAT... You're right. Should converters actually modify the view being converted? It doesn't seem like a big problem, but it's certainly surprising. Also, is the view writer available there? I guess not. |
OK, this is a deeper problem. And it's the same problem as in https://github.com/ckeditor/ckeditor5-list/issues/101 – we need a view writer somewhere. And we need a place to clean up the view being converted. For now, let's use protected methods of view text nodes to change their data. This will be in line with what we have reported in https://github.com/ckeditor/ckeditor5-list/issues/101. |
This PR is ready to review once again. PS: I fixed failed, not related to my changes test. |
Suggested merge commit message (convention)
Other: Removed the unnecesary
model.Writer#setTextData()
andview.Writer#setTextData()
methods. Closes ckeditor/ckeditor5#4316.Should be merged with ckeditor/ckeditor5-list#102.