Changes between Version 3 and Version 4 of Ticket #31157, comment 5
- Timestamp:
- 02/11/2015 03:36:28 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31157, comment 5
v3 v4 3 3 tinymce.on('AddEditor', function(event) { 4 4 5 // stores the editor instance6 5 var editor = event.editor; 7 6 8 // always do this when the editor looses focus 9 editor.on('blur', function (event) { 7 editor.on('getContent', function (e) { 10 8 11 // get the contents, but get them raw! All other formats fail to return the we are looking for12 9 var content = editor.getContent({format: "raw", no_events: 1}); 13 14 // now replace that sucker 15 content = content.replace(/ /ig, ' '); 16 17 //... and re-set the content 18 editor.setContent( content, {no_events: 1} ); 10 e.content = content.replace(/ /ig, ' '); 19 11 20 12 });