Opened 11 years ago

Closed 11 years ago

#11024 closed Bug (duplicate)

Unwanted &nbsp entities should automatically be removed

Reported by: sirtet Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: WebKit Blink Cc:

Description (last modified by Piotrek Koszuliński)

There are many ways how unwanted nobreak spaces are created, eg. by typing 2 spaces and then deleting the regular space (50/50 chance), or after removing a word from a sentence, you get 2 connected spaces, of which one will be a no break space.

This can quickly lead to text, that does not fit the container anymore.

In in FCK Editor Version 2.6.4.1 Build 23187 there was a fix for that (deleting one of 2 neighbouring spaces will always remove the entity), see http://ckeditor.com/comment/128598#comment-128598

Re-implementing the old behaviour, would not solve all issues of that kind, but be a big help already.

Besides re-implementing the old behaviour, i'd suggest a filter, that replaces all nbsp's with a element, that shows the presence of the nbsp with a visible placeholder. Not sure if such a thing would be possible.

One could argue this is not a bug but normal browser behaviour, and therefore should be a feature request at best. But since the behaviour is not what most users (content editors) will expect, i strongly think this IS a BUG.

Related to: #9929.

Change History (7)

comment:1 Changed 11 years ago by Piotrek Koszuliński

cc

comment:2 Changed 11 years ago by Piotrek Koszuliński

Description: modified (diff)
Keywords: WebKit Blink added
Status: newconfirmed
Version: 4.2.2

Perhaps we'll have to go this way. But first we want to wait, because maybe Google/Apple will fix the bug in Blink/WebKit. More details: http://dev.ckeditor.com/ticket/9929#comment:15

comment:3 Changed 11 years ago by sirtet

Well, i am not sure that what i refer to here is related to the browser bug.

I did read in other places, that this is correct browser behaviour: When two consecutive spaces are typed or come together eg. by deleting a word in a sentence, one must be converted into a nbsp, or it could not be rendered.

In such a case, i think CKEditor needs the same logic that FCK 2.6 had...

Can you confirm that 2.6 has such a logic, or is it maybe a plugin, or some other effect?

comment:4 Changed 11 years ago by Jakub Ś

I did read in other places, that this is correct browser behaviour: When two consecutive spaces are typed or come together eg. by deleting a word in a sentence, one must be converted into a nbsp, or it could not be rendered.

That is correct: Browsers change consecutive spaces to   by default. Blink and Webkit produce "  " while IE and FF produce "  ".

For such case FCK plugin sounds IMHO very reasonable.

NOTE: There is however problem with deleting spaces which may or may not cause problems if such plugin gets reintroduced. All browsers (except IE) delete   and leave ' ' while in IE it is possible to delete ' ' and leave  . It all depends where you have placed cursor before deletion.

To check this just create contenteditable element and open it in browser. Next you have to add/remove spaces. Next you have to find this element in Ie dev-tools and copy its innerHtml. Finally you need to paste this HTML into Notepad (or similar editor).

Last edited 11 years ago by Jakub Ś (previous) (diff)

comment:5 in reply to:  3 Changed 11 years ago by Piotrek Koszuliński

Replying to sirtet:

Well, i am not sure that what i refer to here is related to the browser bug.

I did read in other places, that this is correct browser behaviour: When two consecutive spaces are typed or come together eg. by deleting a word in a sentence, one must be converted into a nbsp, or it could not be rendered.

Yes, that's correct. But if browser did only this, then there wouldn't be a problem. But browsers are buggy and sometimes create only   characters. That's a problem.

comment:6 Changed 11 years ago by sirtet

But if browser did only this, then there wouldn't be a problem.

I disagree...

THIS IS THE PROBLEM: Go to the Demo http://ckeditor.com/demo#standard, add two or more spaces into a word, then delete some until only one is left. Now there are good chances, that you have a nbsp instead of a normal space.

Please, can you comment on how this problem is not showing up in FCK 2.6.4.1, as seen in the GX2 Demo http://www.gambio-shop.de/shop1/Haus---Garten/Garten/Grillen/Classic-22-5-Zoll-One-Touch-Gold-Kohle-Grill.html? (login on top, then back, then edit(Produkt bearbeiten) on the left)

comment:7 Changed 11 years ago by Piotrek Koszuliński

Resolution: duplicate
Status: confirmedclosed

THIS IS THE PROBLEM: Go to the Demo http://ckeditor.com/demo#standard, add two or more spaces into a word, then delete some until only one is left. Now there are good chances, that you have a nbsp instead of a normal space.

When deleting one of two subsequent spaces (nbsp+sp or sp+nbsp), browser should always leave the normal space. This is what's broken. And it's broken in browsers.

I'm closing this ticket in favour of #11035. This one isn't clear for me anymore.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy