Support » Fixing WordPress » Non-breaking spaces

  • I’m trying to use non-breaking spaces without success in WP 2.7.

    First off, I am not entering code into the HTML or visual editor. I know what a mess that can be. I’m using the “Insert Custom Character” button and choose the non-breaking space. It does insert a space, but it does indeed break at that point when the post is saved.

    I’ve used this procedure many times in 2.5 and 2.6 without a problem. It seems that it simply does not work in 2.7. Is this a known problem? Known as in acknowledged and slated to be fixed, I mean?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Seriously? No one else is having this problem?!

    Hi, unfortunatly, I have the same problem. Using the native special characters table or the TinyMCE nonbreaking plugin (through WP Super Edit), WP doesn’t insert the famous   entity. Instead, it inserts a plain white space.

    Working on it and hoping to resolve it…

    @rpali – Hi again !

    Found a solution.

    It appears that the WordPress TinyMCE configuration doesn’t allow by default the non-breaking space HTML entity.

    Under the 2.6.3, you may see that in the wp-includes/js/tinymce/tiny_mce_config.php (line 163).

    Under the 2.7, you may see that in the wp-includes/post.php (line 1264).

    The idea of course is to add the entity we needed. For that, TinyMCE expects the hex code and the entity text. For the non-breaking space : 160 and nbsp.

    You may add it by hand in the code simply by extending the lines cited above (eg. ’38,amp,60,lt,62,gt’ to ’38,amp,60,lt,62,gt,160,nbsp’).

    However it is not safe regarding WP upgrades.

    So, I jump into the idea to build a simple plugin to secure that (my first one; so be indulgent).

    Enjoy 🙂 (I have tested on the 2.7 only).

    @rpali – Hi again

    Please note that for 2.6.3 after installing the plugin, you can insert nbsp entity from the charmap.

    However, this feature is broken in the 2.7 for FF. It still works for IE.

    The problem comes from TinyMCE itself.

    It appears that TinyMCE has a bug when inserting nbsp entity (from charmap or using the nonbreaking plugin).

    However the bug affects only FF. I have tested the insert from charmap under IE7 and it works fine (WP 2.7).

    So I guess we have to wait that somebody fixes the thing.

    Please note that even the TinyMCE demo on has the bug (works with IE and not working with FF).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Non-breaking spaces’ is closed to new replies.