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

Spaces inside <code> should be rendered in a normal way #4175

Closed
Reinmar opened this issue Sep 6, 2017 · 6 comments · Fixed by ckeditor/ckeditor5-engine#1129
Closed

Spaces inside <code> should be rendered in a normal way #4175

Reinmar opened this issue Sep 6, 2017 · 6 comments · Fixed by ckeditor/ckeditor5-engine#1129
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Sep 6, 2017

We assumed that subsequent spaces must be rendered in "as is" way in <code> elements, without encoding them to pairs of "space + nbsp". However, this isn't correct, as we learned in ckeditor/ckeditor5-basic-styles#55 (comment).

@scofalik
Copy link
Contributor

scofalik commented Sep 6, 2017

Maybe it will let us skip looking backward in space-replace algorithm.

@Reinmar
Copy link
Member Author

Reinmar commented Sep 6, 2017

It has nothing to do with that. We just need to remove code from the preElements array which introduces special behaviour for them.

@fredck
Copy link
Contributor

fredck commented Sep 6, 2017

Exactly... apart from styling, I don't see much difference between code and strong, for example.

@scofalik
Copy link
Contributor

scofalik commented Sep 6, 2017

Well, we look back because we assumed that there are elements in which we don't want to convert spaces to &nbsp;s. <code> was supposed to be such an element. If this is not a case, then why should we look back?

@Reinmar
Copy link
Member Author

Reinmar commented Sep 6, 2017

If this is not a case, then why should we look back?

You might be right that we don't need to look back if we'd assume that previous text node's last space is always converted to nbsp, but this is not related to the <code> stuff. We assumed that spaces inside <code> are preformatted anyway, so that they behave like nbsps.

@scofalik
Copy link
Contributor

scofalik commented Sep 6, 2017

Okay I won't argue because I don't remember that algorithm and all the cases precisely.

Reinmar referenced this issue in ckeditor/ckeditor5-engine Sep 8, 2017
Fix: Spaces inside `<code>` will be rendered in a normal way (previously `DomConverter` tried to treat `<code>` like a preformatted block which is not what HTML requires). Closes #1126.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 12 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. 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
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants