[wp-trac] [WordPress Trac] #27149: Spaces Not Preserved During Paste

WordPress Trac noreply at wordpress.org
Wed Feb 19 02:24:57 UTC 2014


#27149: Spaces Not Preserved During Paste
--------------------------+------------------------------
 Reporter:  miqrogroove   |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  TinyMCE       |     Version:  3.8.1
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------

Comment (by Ipstenu):

 Well this is news to me. If I write a post in HTML view (which I almost
 always do) and put in this:


 {{{
 Hello.  World. This is space testing.
 }}}

 I get this:

 Hello. World. This is space testing.

 There is no double space between Hello. and World. However in Visual
 Editor (on 3.9) it retains the double space by virtue of adding in an nbsp

 {{{
 <p>Hello.  World.</p>
 }}}

 Now. As we all know, switching between Visual and HTML editors is how one
 goes insane. Two actual spaces (not an nbsp) ''will'' be eaten by HTML and
 not shown. It's just how it works. The way the visual editor gets around
 it is with that non-breaking space, which is kinda bad html, but oh well.
 I am not TinyMCE ;)

 This non-breaking space is '''not''' removed in TinyMCE4 when you switch
 between Visual and HTML editors. As mentioned, the "Paste From Word"
 option is removed (all pasting is assumed to be 'please retain my
 formatting' unless you explicitly click 'paste as text'), but again, the
 space is not removed when you paste from Word '''unless''' you click the
 "Paste as plain text" button. And that makes sense because we're stripping
 out the non-text characters (of which nbsp is one).

 Though arguably you shouldn't be using the double-space like that online
 (see https://en.wikipedia.org/wiki/Sentence_spacing_in_digital_media and
 it does go on and on).

 Semi related to #19936 as well I suppose.

 I would still close this. It's TinyMCE behaving as it's supposed to. The
 only problem is if you paste as plain text, and I would argue that's as
 expected, given what the code is actually doing here.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27149#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list