Skip to content
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

Defining length mapping. #3604

Closed
pjasiun opened this issue Mar 14, 2016 · 1 comment
Closed

Defining length mapping. #3604

pjasiun opened this issue Mar 14, 2016 · 1 comment
Labels
intro Good first ticket. package:engine type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@pjasiun
Copy link

pjasiun commented Mar 14, 2016

Now length of the view element in the model is always 1 (1 view element responds 1 model element) and the length of the text is the text length (view text length responds model text length). It should be possible do define length mapping so, for example:

  • one model element could be mapped to 2 view elements,
  • some view text could have model length 0, so they have no corresponding model text.

Because of the performance of the mapper, instead of using events, there should be a setLength function which store the lengths in the map where the access is quick.

@scofalik
Copy link
Contributor

This has been resolved in ckeditor/ckeditor5-engine#584 by introducing Mapper#registerViewToModelLength function that takes a view element name and a function that evaluates view element length in the model.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added intro Good first ticket. resolution:solved type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. package:engine type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

3 participants