[wp-trac] [WordPress Trac] #31157: TinyMCE inserts non-breaking spaces in unwanted places
WordPress Trac
noreply at wordpress.org
Thu Jun 9 01:22:43 UTC 2016
#31157: TinyMCE inserts non-breaking spaces in unwanted places
--------------------------+-----------------------------------------
Reporter: nonverbla | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: TinyMCE | Version: 4.1
Severity: normal | Resolution: duplicate
Keywords: | Focuses: javascript, administration
--------------------------+-----------------------------------------
Changes (by azaozz):
* status: new => closed
* resolution: => duplicate
* milestone: Awaiting Review =>
Comment:
This is not new, see #26842. It is the browsers that insert these U+00A0
which is the UTF-8 for ` ` in contentEditable. And what's worse:
different browsers are inserting them at different places.
Generally they all add them to keep consecutive spaces. You know that
white space doesn't matter in HTML unless it is in a `<pre>` tag, so when
the user types several spaces in contentEditable, the browsers use a
"hack" to keep all of them visible, i.e. insert U+00A0 chars.
Lately some browsers are more aggressive and also insert these chars at
seemingly random places. Seems Chrome is worst, in some cases it inserts
tons of U+00A0 all over.
So the short answer is: this is not a bug, this is a feature in your
browser :)
The longer answer is: there is not much we can do to fix this behavior. We
can of course replace all U+00A0 that don't make much sense, but we have
no way of knowing if the user inserted them there on purpose or if the
browser did it behind the scenes. So replacing them will introduce bugs
and edge cases.
Closing this as duplicate of #26842. The best case is if this behavior is
fixed/improved in the browsers, although it has existed for many years and
seems to be getting worse. We can work on exposing the ` ` so at
least the users can delete them in the Text editor.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31157#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list