-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent "upcast writing" #4423
Comments
Probably because
That's the second issue that We already have one task to utilize |
Agree that upcast writer should be used there. We can even create an instance in the clipboard plugin and put next to
This is a good idea too. However, we need to ensure that it is possible. It might be impossible if the |
AFAICS there should be no problem. Cool. Which |
Yep, we should introduce BTW, there is no |
So this issue is for introducing those 3 above methods to What about:
Do we know that this change is needed? Should it be also covered here or in a separate issue? |
Without returning from change() creating nodes is just sadly complicated. You create them inside the callback and need to assign them to a variable defined outside. So to completely clean the code I posted above we need that. I’d do both things at once.
…Sent from my iPhone
On 17 Sep 2018, at 15:57, Krzysztof Krztoń ***@***.***> wrote:
we should introduce createDocumentFragment, createElement and createText
So this issue is for introducing those 3 above methods to UpcastWriter? (and eventually correcting the clipboard docs).
What about:
View#change() doesn't return the return value of its callback just like Model#change() does...
Do we know that this change is needed? Should it be also covered here or in a separate issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Feature: Introduced `createDocumentFragment()`, `createElement()` and `createText()` methods in `UpcastWriter`. Additionally, the `View.change()` method now returns the return value of its callback. Closes #1549.
We've just introduced
UpcastWriter
and when I've stumbled upon this piece of code (in the documentation) I thought that something's wrong:Why aren't we using
UpcastWriter
here? If, instead of creating a fresh new document fragment, we'd like to modify the one indata.content
, we'd need to use the upcast writer. So I actually thought that this piece of code is wrong... and it is – constructors of these node classes are protected so we can't use them like this. But they are not exposed inUpcastWriter
.Also,
View#change()
doesn't return the return value of its callback just likeModel#change()
does which would be highly inconvenient.The text was updated successfully, but these errors were encountered: