[wp-trac] [WordPress Trac] #21025: WordPress' TinyMCE automatically remove Invisible Space (\u200B)

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 26 20:55:10 UTC 2012


#21025: WordPress' TinyMCE automatically remove Invisible Space (\u200B)
--------------------------+-----------------------
 Reporter:  so_vichet     |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  assigned
 Priority:  low           |   Milestone:  3.4.1
Component:  TinyMCE       |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+-----------------------

Comment (by azaozz):

 As far as I understand, the problem here is not that \u200B is used as
 "placeholder", but that this char is stripped from the content when
 TinyMCE does cleanup.

 When used as placeholder \u200B seems to be at the beginning or the end of
 the text string (or the only char there). So maybe the stripping can be
 changed to:

 {{{
 args.content = args.content.replace(/^[\uFEFF\u200B]+/,
 '').replace(/[\uFEFF\u200B]+$/, '');
 }}}

 To test this: make sure SCRIPT_DEBUG is set to true, download the TinyMCE
 3.4.9 development package from
 http://www.tinymce.com/download/download.php, then rename tiny_mce_dev.js
 to tiny_mce.js and replace it in wp-includes/js/tinymce.

 Edit the non-minified tiny_mce.js, change line 8621 to the above example.

 Alternatively line 16492 can be changed to:

 {{{
 invisibleChar = INVISIBLE_CHAR;
 }}}

 This will stop TinyMCE using \u200B as placeholder in Firefox but won't
 stop some browsers inserting it on paste, etc. so there would probably be
 some \u200B left in the content without being typed by the user.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21025#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list