-
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
View: Rendering and handling (in mutations) spaces at block boundaries and multiple spaces. #3685
Comments
Makes sense. |
TC 3
Expected result: Actual result: Reason:
After the We should render one of these spaces as |
Originally submitted in: https://github.com/ckeditor/ckeditor5-typing/issues/30 TC4Similarly to TC1 and TC2: Steps to reproduce:
What happens: TC5Steps to reproduce:
What happens: In both cases, space should be converted to |
OK, this issue is getting serious, because it's pretty evident and fails quickly. To the cases described above I'd also add: <heading1>Heading 1</heading1>
<heading2>[] </heading2>
<paragraph><$text italic="true">This</$text> is an <$text bold="true">editor</$text> instance.</paragraph> The |
Related issue: https://github.com/ckeditor/ckeditor5-engine/issues/606. Defines that spaces must be normalised when converting back to the model. I guess that both issues must be fixed together. |
Okay, let's summarize some knowledge that is spread around multiple issues and what we concluded:
I think that most stuff that has to be done is clear but loading the content is not really, at least not for me. Let's say that somebody initializes editor with such html: <div id="editor">
<p>
myText
</p>
</div> What about whitespaces inside Keep in mind that I am not that familiar with |
I agree. Especially that it may depend on page styling. DOM renderer is the only bit which should be concerned by that.
We always tried to not depend on certain page styling and not to force anything.
This may require a separate handler for Shift+Space because we won't be able to distinguish what was the user intention based on mutations.
They need to be normalised... Either upon conversion (view->model) or by the DOM converter (DOM->view). The latter won't handle spaces if e.g. Markdown DP was used, because then the DOM converter may not be used (MD->view->model).
All should be removed.
Hmmm.... that's true. |
This is actually wrong, shift + space does not insert EDIT: In fact it might actually be better for us cause we can do it manually and we don't have to fight the browser. |
After some digging into the problem here is what I discovered and how I plan to solve this issue:
|
1 and 2 are fine for me. But:
No, they do not. They fire only the event which should have view data. For text there was not trasformation, because we did nothing with text. Now the text in the event fired from the mutation observer should be "view text". |
Agree with @pjasiun. |
We need to figure out what to do with ckeditor/ckeditor5-design#61
Problems
TC1
Imagine that your model contains paragraph with
"foo "
. This needs to be rendered as<p>foo </p>
.TC2
User is typing at the end of a paragraph – "foo bar". We have "foo", then user presses space. That space must be rendered as
(we actually get
in a mutation). Then, two things may happen:Ideas
nbsp
to the model. Existence of such a feature shows that the model must always contain clean data.Alternative (temporary) workaround: we may for now use the CSS property which I described in ckeditor/ckeditor5-design#61 and do not care about this at all. The editor should work perfectly.
The text was updated successfully, but these errors were encountered: