Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Non-breaking spaces

I've been finding that some of the spaces in my articles are being converted into nbsp's. Sometimes quite a lot of them are, sometimes only a few. I haven't managed to figure out a way of reproducing this reliably, though.

I think it might happen when I'm working on a section where I write a bunch, backspace, and write again. If I backspace to a space and go forward, I think it might convert it to an nbsp -- but I'm not really sure.

Steven C. Den Beste
Wednesday, January 02, 2002

If you have two spaces, it has to put in a   and then when you delete one of them, if it happens to be the natural space that you deleted, the   will remain. This is probably wrong but I'm not sure what to do about it. It is certainly *not* the right thing to convert lone   to regular spaces, because the   might have been intentional.

Just one of those annoying things about HTML...

Joel Spolsky
Wednesday, January 02, 2002

If you insert a bunch of raw images into a page, separated by single spaces, then look at the HTML, they will be non-breaking spaces. I have to go to HTML View to change them back to natural spaces for a page like this one:
http://www.pool-room.com/Personal/House/Garden/fog0000000035.html

Is there an easy fix for this?

Darren Collins
Wednesday, January 02, 2002

Here are a couple of workarounds:

* You can try cutting and pasting a normal space from somewhere else on the page.

* Or - insert "x y z" then replace the x, y, and z with the pictures you want.

(If anyone can think of a good solution to deciding when to insert   and when not to, I'd love to hear it.)

Joel Spolsky
Wednesday, January 02, 2002

Joel, all other things being equal I'd really prefer that you never put in any nbsp's. I can't think of a single case where I want one.

Steven C. Den Beste
Thursday, January 03, 2002

The theory is that if somebody really wants a bunch of spaces, and hits the space bar a bunch of times, the cursor should keep on moving to the right and they should get a bunch of space. I think if you gave people a word processor where you could never enter more than one space, people would think their space bar was broken :)

Joel Spolsky
Thursday, January 03, 2002

I agree with Joel. Old versions of FrontPage did not allow you to insert multiple spaces in the normal way. Apparently there was enough kick back, because newer version of FrontPage turn multiple spaces into   and now it works just like a word processor.

Brad Wilson
Thursday, January 03, 2002

Joel writes...  "The theory is that if somebody really wants a bunch of spaces, and hits the space bar a bunch of times, the cursor should keep on moving to the right and they should get a bunch of space. I think if you gave people a word processor where you could never enter more than one space, people would think their space bar was broken :)"

This sounds to me like one of the tradeoffs between ease of use and standards (CSS and the <span> tag). I guess it's more pragmatic to "give the people what they want" (i.e., multiple spaces), but personally I'd also prefer that &nbsp; wasn't used this way.

It reminds me a bit of when word processors first appeared. People couldn't be bothered learning how to use tabs, but then they got frustrated when they changed fonts and found that their multi-space indents got screwed up.

I wish there was a way of integrating CSS more closely with the "word processor" model CityDesk appears to be working toward...

Cheers.

M.

Michael O'Henly
Thursday, January 03, 2002

I guess this is one of those places where you can't please everyone. I do remember the frustration at having FrontPage ignore the spacebar.

Perhaps the solution is to make character backspacing smarter. If you delete through a sequence of spaces and leave only one, make sure that it gets switched from an nbsp to a normal space.

Steven C. Den Beste
Thursday, January 03, 2002

I kind of liked how FrontPage only allowed single spaces. It saved me having to tidy up after cut-and-paste operations. I'd like it if CityDesk only inserted natural spaces by default, but allowed you to enter a non-breaking space by typing Shift-Space.

Darren Collins
Sunday, January 06, 2002

Yeah, that seems to be the solution most apps take. Does anyone have a good argument why that shouldn't work here?

Did FrontPage not allow you to type in nbsp's at all, or was the problem really that people wanted to type them without the shift key? It would be nice to know what the exact complaint was.

Maury Markowitz
Sunday, January 06, 2002

The problem was, I think, non-intuitive UI. They wanted FrontPage to work like Word, and in Word you certainly didn't need to use Shift+Space. In fact, until you mentioned, I wasn't even aware that FrontPage might have done this, and I'm a highly technical user.

Given CityDesk's intended audience (non-technical content creators), using the Shift+Space option seems like a non-starter to me.

Brad Wilson
Monday, January 07, 2002

*  Recent Topics

*  Fog Creek Home