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

WordPress Trac noreply at wordpress.org
Wed Feb 19 18:32:36 UTC 2014


#27149: Spaces Not Preserved During Paste
--------------------------+-------------------------
 Reporter:  miqrogroove   |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  TinyMCE       |     Version:  3.8.1
 Severity:  minor         |  Resolution:  worksforme
 Keywords:  close         |     Focuses:
--------------------------+-------------------------
Changes (by azaozz):

 * status:  reopened => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Both @Ipstenu and @miqrogroove are right :)

 In HTML multiple spaces, tabs and line breaks are displayed as a single
 space (unless in a <pre> tag). However in contenteditable mode all
 browsers preserve consecutive spaces by inserting ` `. This used to
 be browser dependent some time ago if I remember right, and is still
 inconsistent. IE and Firefox would insert several ` ` followed by a
 single space, WebKit would insert ` ` instead of every other space.
 Note that this is a feature of the browsers, not controlled by TinyMCE.

 When pasting in a textarea the spaces are literal, the browsers do not
 insert ` `. This is maintained when "Paste as Text" is toggled on in
 TinyMCE 4.0 too.

 So, to preserve multiple white spaces, the user needs to paste in the
 Visual editor and the "Paste as Text" has to be turned off (the default).
 This is IMHO the correct behaviour.

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


More information about the wp-trac mailing list