• If you use the included editor to add the non-breaking space special character, it seems to add nothing. Not even a regular space. The editor shows nothing, and I’ve viewed the resulting post in Safari and Firefox…and see no space at all, breaking or not.

    Can anyone confirm that this is an issue? I’ve searched the forum and found only posts from about five years ago when this was also an issue, though a regular breaking space was inserted in that case, not nothing at all!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You mean you type   while in Text mode, and it disappears if you open it later in Visual mode?
    If yes, that is normal behavior for WP, it strips away what it “sees” as mistakes or unneccessary html when you enter Visual mode.
    But can be undone with a function.
    Add this to functions.php:

    function shortcode_empty_paragraph_fix( $content ) {
            $array = array (
                '<p>[' => '[',
                ']</p>' => ']',
                ']<br />' => ']'
            );
            $content = strtr( $content, $array );
            return $content;
        }
        add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );

    Be sure your functions.php file ends with ?> (if <?php is at the beginning of the first line)

    Thread Starter rpali

    (@rpali)

    No…I select the Special character button (The omega) and choose the ‘blank’ character in the upper left corner, the non-breaking space. The tool-tip confirms that’s what it is. But it’s not in this version.

    OK, I see it. I never used it before. All it does is add a nbsp? but it doesn’t shift the cursor position, so unless you use the down arrow after you use that blank character, all the nbsp’s are after everything you’ve typed. Kinda useless.
    Just hitting Enter gives you a nbsp

    Thread Starter rpali

    (@rpali)

    It is useless in its current state because it doesn’t work properly! It used to work, but not in this version.

    I’m not sure what you mean by “All it does is add a nbsp but it doesn’t shift the cursor position” because by definition, a space does indeed shift the cursor position.

    Still, I’m grateful to know that it’s not just me. Thanks for writing.

    What I mean is this:
    Using Visual mode, type something, then use the special character maker to make the nbsp’s 2 or 3 times.
    Now type again and the flashing vertical cursor bar hasn’t moved to the end of the breaks, but the breaks are there, switch to Text mode and you’ll see them.
    So, yah, then I guess it’s messed up, since you have to press the down arrow on the keyboard to have what your typing be AFTER the breaks you created.

    Thread Starter rpali

    (@rpali)

    That’s doubly weird because I often want to change regular spaces to non-breaking spaces. To do so, I select the space, and then chose the non-breaking space button, as I described earlier. The result is that the space collapses to nothing. It appears that there’ son space of any kind. So weird.

    Thread Starter rpali

    (@rpali)

    I did as you said, switched to text mode, and I see nothing. No breaks, no space, no nothing. Even after publishing the post, viewing the source in any browser reveals nothing where I inserted the non-breaking space.

    It seems the next step is to search the bugs.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Non-breaking space broken in 3.9.1’ is closed to new replies.