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

Inline widget does not preserve trailing space #605

Closed
gfox1984 opened this issue Jul 5, 2017 · 3 comments · Fixed by #680
Closed

Inline widget does not preserve trailing space #605

gfox1984 opened this issue Jul 5, 2017 · 3 comments · Fixed by #680
Assignees
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Milestone

Comments

@gfox1984
Copy link

gfox1984 commented Jul 5, 2017

Are you reporting a feature or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Create a widget plugin for an inline element (eg: span)
  2. Load some data in CKEditor with a trailing space inside the element to be converted to a widget (eg: <span>lorem </span>ipsum )

see JSFiddle here: https://jsfiddle.net/cf5d457L/5/

Expected result

The following text to be displayed: lorem ipsum

Actual result

The following text is displayed (notice the missing space): loremipsum

Other details

  • Browser: all
  • OS: all
  • CKEditor version: latest (4.7.0)
  • Installed CKEditor plugins: the Full preset together with all other plugins created by CKSource
@mlewand mlewand added status:confirmed An issue confirmed by the development team. type:bug A bug. plugin:widget The plugin which probably causes the issue. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. labels Jul 5, 2017
@gfox1984
Copy link
Author

While waiting for a fix, I wrote a work around that forces the last trailing space to be replaced with a non breaking space when upcasting the widget, and then replace it again with a space when downcasting it.

Updated fiddle here: https://jsfiddle.net/tuk1y92j/

@beatadelura beatadelura self-assigned this Jul 20, 2017
@beatadelura
Copy link
Contributor

It's happening because every white space and trailing space each inline element is removed. It's when inline element has css white-space set to normal, nowrap, pre-line. While white-space set to pre or pre-wrap cause all white characters in the source are preserved.

To read more, click link.

@beatadelura
Copy link
Contributor

There is one case which will not be fixed with this issue because it's related to core code. Please see #791.

@f1ames f1ames added the target:major Any docs related issue that should be merged into a major branch. label Oct 9, 2017
@f1ames f1ames added this to the 4.8.0 milestone Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants