Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Reliable way to create spurious nbsps

I finally figured out what it was that I was doing to create so many non-breaking spaces in my text. It has to do with how I was doing insertions.

Here's the experiment. Create an article and enter the following:

aaa bbb ccc ddd eee

Now click just after the "ccc" and before the following space, and type "(space)insertion":

aaa bbb ccc insertion ddd eee

The resulting code is as follows:

aaa bbb ccc insertion ddd eee

...with an nbsp just after the word "insertion".

The problem is that when you type the first space, you have two in a row. The second one is being changed into an nbsp. Then when you continue typing and it is no longer a doubled-space, it remains an nbsp even though it doesn't need to be.

This can be avoided by doing the insert after the space instead of in front of it, but psychologically that's not what I think of doing, because it means that the text I'm inserting in front of seems to be concatanated to what I'm typing. It doesn't feel right. By doing the insert where I do (in front of the space), there's a space between my typing and what I'm inserting in front of. Only it's an nbsp, and it stays an nbsp even though it doesn't need to be once I'm done.

What I would ask for is this: if there is a space followed by an nbsp, and something is inserted between them, convert the nbsp into a normal space.

Is this possible?

Steven C. Den Beste
Saturday, January 26, 2002

*  Recent Topics

*  Fog Creek Home