A non-breaking space character, entered with TinyMCE turned off, is somehow automatically replaced with a regular space character the first time when opened with TinyMCE turned on (both in Firefox and in M$IE). It is extremely annoying, as it messes up the display of the content in some table fields on my site. How to make TinyMCE not to touch a character?
I've seen some posts on TinyMCE site about that, but they seems to be related to Firefox (they say M$IE is OK). For me, it is absolutely the same in both browsers. It would be nice to know where it happens and if there is some more elegant way to disable it as to mess with the TinyMCE code (maybe some theme variable setting or so?).
For the future, it would be nice to have a admin setting for this as a part of the module. Or, simply to make it a default not to be too clever - the user normally puts it there with a certain intention, or?! At the end, it is much more simple to put a normal space where it is enough... ;-)
Comment | File | Size | Author |
---|---|---|---|
#3 | tinymce-remove_linebreaks-option.patch | 2.55 KB | mcurry |
Comments
Comment #1
halfer CreditAttribution: halfer commentedI had exactly this problem, and discovered this behaviour may be down to this:
http://tinymce.moxiecode.com/tinymce/docs/option_entity_encoding.html
I switched my encoding to 'named', and the issue seems to have gone away (certainly on Firefox 1.5.x). Hope that helps!
Comment #2
ricmadeira CreditAttribution: ricmadeira commentedI encountered this problem long ago, and solved it by adding the following lines to tinymce.module (sorry, don't know how to create a proper patch) so that I could further configure the behavior of the editor.
These lines add two new settings in the admin panel for the module, and you can manipulate them to change the behavior of TinyMCE. If you change the setting "Convert new lines to BRs" from the default "False" to "True", the problem will be solved because the newline characters will be replaced with HTML linebreaks.
I'm updating priority to critical because this issue is a true pain in the neck for sites where the use of the editor is optional.
1st Edit:
2nd Edit:
Comment #3
mcurry CreditAttribution: mcurry commentedHere's a proper patch for review, based on the changes suggested above. Please review and comment.
Comment #4
kreynen CreditAttribution: kreynen commentedhttp://drupal.org/node/130304
Comment #5
Yao CreditAttribution: Yao commentedhttp://wiki.moxiecode.com/index.php/TinyMCE:Configuration/entity_encoding
To make tinymce not to replace entities' names with their codes or whatever we need to have this:
tinyMCE.init({
...
entity_encoding : "raw"
});
So I added
$init['entity_encoding'] = array( "named" );
to tinymce_process_textarea function in tinymce.module (after $init['elements'] = 'edit-'. $textarea_name;)
Comment #6
Yao CreditAttribution: Yao commentedSorry, correct varsion:
tinyMCE.init({
...
entity_encoding : "named"
});