Fixing the Nbsp Bug: Why   Turns into *

  • Thread starter Thread starter Hurkyl
  • Start date Start date
AI Thread Summary
The discussion revolves around a bug where non-breaking spaces ( ) in posts convert to asterisks (*) upon editing and resubmission. Users explore various methods to maintain non-breaking spaces, including using Unicode codes, but find inconsistencies, particularly when editing or quoting. Some participants share tips for inserting non-breaking spaces in different word processors, noting that the functionality may vary between platforms like Mac and PC. The conversation highlights the frustration with formatting issues and the need for reliable solutions to control text spacing in posts. Overall, the thread emphasizes the challenges of using non-breaking spaces in online text editing.
Hurkyl
Staff Emeritus
Science Advisor
Gold Member
Messages
14,922
Reaction score
28
Ack! Stupid non breaking spaces!

I found a bug:

Suppose I include a non-breaking space (& nbsp ;) into one of my posts, such as the one seen here: →   .

Now, I follow this procedure:

I edit the post, and then submit it without any changes.

The nonbreaking space turns into an asterisk, as shown here: → * .

(I applied this procedure to this post, BTW, though I re-entered the code for the first nonbreaking space)
 
Physics news on Phys.org
ExperimentExperimentExperimentExperimentExperiment5 ExperimentExperimentExperimentExperiment9Experiment10ExperimentExperiment12 ExperimentExperiment
 
Last edited:
honestrosewater said:
Experiment.................. ... ...
Maybe & #160 ; works. Yes, it seems to work, but the source code still looks funny. Hm, apparently it doesn't work. Okay, well, it at least stays a space- I just can't tell if it breaks or not- spaces are put in automatically for some reason.? Okay, it works the first time, but afterward shows up as a regular space.

I remember having a similar problem with some other code, but I can't remember what it was. Anywho, I don't know if the non-breaking space in unicode is different, but using the unicode code fixed the problem before, even though unicode doesn't automatically work in IE (of course :rolleyes: ).
 
Last edited:
What the hell is a 'non-breaking space'?
(Sorry, but you 2 seemed way too content just being off in this thread by yourselves.)
 
Danger said:
What the hell is a 'non-breaking space'?
(Sorry, but you 2 seemed way too content just being off in this thread by yourselves.)
Good, I was feeling rather lonely here. I suspect you already know (aren't you a writer?), but a non-breaking space just doesn't allow a line break. :rolleyes: If I want to type O U C H ! but don't want part of it to end up getting wrapped to the next line, like O U C
H ! , then instead of putting normal spaces between each letter, I put non-breaking spaces between each letter so they all stay on the same line. :smile:
 
Last edited:
Danger: Try   putting   lots   of   space   between   words   like   this.
 
Hurkyl said:
Danger: Try putting lots of space between words like this.
If that's what you want to do, in the meantime, you can use white text, like------[/color]so.
 
or you could just use the
[ code ]

[ /code ]

tags
 
honestrosewater said:
Good, I was feeling rather lonely here. I suspect you already know (aren't you a writer?), but a non-breaking space just doesn't allow a line break. :rolleyes
Nope. Sorry. The only word processors that I've used are Atariwriter and Word Perfect 5 (and TED, about 25 years ago when I used to sneak into the basement of the Math building at U of C and steal a few hours on Multix in the middle of the night). As far as I know, none has that feature. The closest that I'm familiar with is a code which suppresses auto-hyphenation on a by-the-word basis. My beloved WP5 won't run on my even-more beloved Mac, so I'm stuck with MS Word. Unfortunately, since it came with the computer I don't have a manual. I've wondered about it a bit on this thing that we're using right now, because I get quite irritated when a smilie ends up on a line by itself. Are there instructions for this somewhere?
 
  • #10
Danger said:
Nope. Sorry. The only word processors that I've used are Atariwriter and Word Perfect 5 (and TED, about 25 years ago when I used to sneak into the basement of the Math building at U of C and steal a few hours on Multix in the middle of the night). As far as I know, none has that feature. The closest that I'm familiar with is a code which suppresses auto-hyphenation on a by-the-word basis. My beloved WP5 won't run on my even-more beloved Mac, so I'm stuck with MS Word. Unfortunately, since it came with the computer I don't have a manual. I've wondered about it a bit on this thing that we're using right now, because I get quite irritated when a smilie ends up on a line by itself. Are there instructions for this somewhere?
I've only used Word and found it adequate. I sort of even like Word. :redface: I don't know if you're asking about Word or PF, so...
To insert a non-breaking space in Word, click on the Insert menu > select Symbol > click the Special Characters tab > highlight nonbreaking space in the list > click the Insert button. There are various shortcuts if you use it often.

To insert a non-breaking space in PF, I guess there's at least two options.
You can type & # 1 6 0 ;[/color] without the spaces wherever you want the space to appear.
For example:
witty remark& # 1 6 0 ;:smile:[/color]
Result:
witty remark :smile:
But the non-breaking space turns into a regular space when it's "cycled through" or whatever a second time, as when you edit, preview, or quote.
A little more trouble, but would always work- type [color = white]-[/ color][/color] without the spaces wherever you want the space to appear.
For example:
witty remark[color = white]-[/ color]:smile:[/color]
Result:
witty remark-[/color]:smile:
 
Last edited:
  • #11
honestrosewater said:
I've only used Word and found it adequate. I sort of even like Word. :redface:
We all have our shameful secrets. :-p
Thanks for the tips, Rosie. It was PF that I was asking about, but the info about Word will probably come in handy some time.
 
  • #12
honestrosewater said:
I've only used Word and found it adequate. I sort of even like Word. :redface: I don't know if you're asking about Word or PF, so...
To insert a non-breaking space in Word, click on the Insert menu > select Symbol > click the Special Characters tab > highlight nonbreaking space in the list > click the Insert button. There are various shortcuts if you use it often.

To insert a non-breaking space in PF, I guess there's at least two options.
You can type & # 1 6 0 ;[/color] without the spaces wherever you want the space to appear.
For example:
witty remark& # 1 6 0 ;:smile:[/color]
Result:
witty remark :smile:
But the non-breaking space turns into a regular space when it's "cycled through" or whatever a second time, as when you edit, preview, or quote.
A little more trouble, but would always work- type [color = white]-[/ color][/color] without the spaces wherever you want the space to appear.
For example:
witty remark[color = white]-[/ color]:smile:[/color]
Result:
witty remark-[/color]:smile:

None of the codes anyone has suggested have ever worked for me from a Mac. I'll give yours a try though. For some reason, PF doesn't "see" the code the same when it's sent from my mac as when it is sent from a     PC. (I just inserted three spaces before "PC" with the code you listed above...lets see if they appear as nothing or as question marks or asterisks, or *gulp* spaces!).
 
  • #13
Moonbear said:
None of the codes anyone has suggested have ever worked for me from a Mac. I'll give yours a try though. For some reason, PF doesn't "see" the code the same when it's sent from my mac as when it is sent from a PC. (I just inserted three spaces before "PC" with the code you listed above...lets see if they appear as nothing or as question marks or asterisks, or *gulp* spaces!).
Woo hoo! They're spaces! Or they are for me. But "a---[/color]PC" should have stayed on the same line. :frown:
I don't know very much about the whole thing. I just learned enough to write some html and xhtml. Every character has a numeric code and some have name codes (ex. nbsp, amp). If you need or want to use the code, you enclose it in an ampersand and semicolon: & nbsp ;[/color]. If it's a numeric code, you put a hash in front of the numbers: & # 160 ;[/color]. But there are different character sets, so it gets more complicated. Plus, on PF, the text in the text box goes through other doohickies that I know nothing about. :)

But I can still write "Moonie" in ISO-8859-1, using the numberic codes. M-77, o-111, n-110, i-105, e-101: Moonie. It should work for you too.

If you're running Windows, you can use the Character Map (Start > Programs > Accessories > System Tools > Character Map).
 
  • #14
Yep, they're spaces for me too :biggrin:, but "a      PC" ended up in the middle of a line for me, so I couldn't see if it would break or not. That's okay, I don't often need non-breaking spaces, but sometimes just being able to add extra spaces is something I want to do for emphasis or to get something aligned correctly.
 

Similar threads

Replies
5
Views
1K
Replies
25
Views
4K
Replies
1
Views
2K
Replies
14
Views
5K
Replies
5
Views
2K
Replies
21
Views
2K
Back
Top