[wp-trac] [WordPress Trac] #31157: TinyMCE inserts non-breaking spaces in unwanted places

WordPress Trac noreply at wordpress.org
Wed Oct 21 22:28:29 UTC 2015


#31157: TinyMCE inserts non-breaking spaces in unwanted places
--------------------------+-----------------------------------------
 Reporter:  nonverbla     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  TinyMCE       |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  javascript, administration
--------------------------+-----------------------------------------

Comment (by kashmiri):

 Replying to [comment:5 nonverbla]:
 > so... I think I found a real work-around for this. I put this script
 after the tinymce script, using the 'after_wp_tiny_mce' action hook:
 > {{{
 > tinymce.on('AddEditor', function(event) {
 >
 >   var editor = event.editor;
 >
 >   editor.on('getContent', function (e) {
 >
 >     var content = editor.getContent({format: "raw", no_events: 1});
 >     e.content = content.replace(/ /ig, ' ');
 >
 >   });
 >
 > });
 > }}}
 > Any thoughts on this approach?

 It it working for you? Would you be able to add a browser sniffer (for
 Chrome) and, perhaps, list the entire code including hooks for novices
 like me? Thanks!

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


More information about the wp-trac mailing list