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
Text nodes simplification #3756
Comments
https://github.com/ckeditor/ckeditor5-engine/issues/255 view An additional change we could apply here is merging Also if |
In F2F discussion we come to conclusion that it is worthy to consider removing Why so? We already have this approach in view. In fact, in view and in model we have same problem: we have a basic structure, in which texts are nodes but we need some easy method to operate on those texts when we have a position inside a text node and we want to do something there, i.e. change attributes of part of text or insert something inside text node. Right now we solve this same issue differently both in model and in view. In model, there is no Still, in model, we need to operate on single characters, because we might want to change attributes of part of text node or remove only part of text node. So we would need to have dobule API in There are multiple pros of such division:
I am sure that we need to refactor this part also, while working on this issue. |
It would be great to replace |
And |
Yep, that is true. |
The original concept was to have every character as a separate node. It did no work.
Then we had an idea to merge them together and make them act like a separate characters. This is why we have
CharacterProxy
which is aNode
,TextProxy
which is not aNode
,Text
to insert a text with attributes and privateNodeListText
to keep compressed text. This is why I have no idea how to copyNodeList
it the efficient way or I need to think event time which API I should use in each case.No more lies!
This lie, does not make much sense, since we decided that even
TreeWalker
return whole texts by default.First we should apply some change, easy to agree:
Text
is aNode
,Text
andNodeListText
should be merge into a single class,CharacterProxy
andTextProxy
should be merge into a single class (TextProxy
orTextFragment
),NodeList
has no hidden internal structures, is containsText
s.Then we will see what this change will bring. It may change the way
Positions
work and changeTreeWalker
API, but I think that we should keep the change as simple as possible at first and then introduce new features to it.Also, note that having only
Text
andTextFragment
(for whatTreeWalker
returns when you start iterating inside a text or ask for single characters) we will have the same classes in model and the view.Related: https://github.com/ckeditor/ckeditor5-engine/issues/350, https://github.com/ckeditor/ckeditor5-engine/issues/351, https://github.com/ckeditor/ckeditor5-engine/issues/353, https://github.com/ckeditor/ckeditor5-engine/issues/357, https://github.com/ckeditor/ckeditor5-engine/issues/321, https://github.com/ckeditor/ckeditor5-engine/issues/428.
The text was updated successfully, but these errors were encountered: