Forum How do I...?

Non-breaking space ( ) adding space at the beginning of a line

quiredan
Some of our users still think they need to add 2 spaces after a period. Because of the way spaces work in HTML, these 2 spaces are added to the content as 1 actual space and then 1 non-breaking space character ( ).

Sometimes this results in the non-breaking space character being the first character on a line which adds a visible space before the first word

I'm assuming the only way to handle this is to add some javascript that removes the   when it appears at the beginning of a line? I just wanted to see if there were any other solutions since we don't currently don't use the javascript features in Prince.

Has anyone else run into this issue?
mikeday
I think this is actually quite tricky to get right in HTML, as well as being a highly discouraged typesetting mistake in the modern era.

Why you should never, ever use two spaces after a period.

However perhaps you could try putting the nbsp first and follow it with the regular space? Then it will only appear at the end of lines instead of the beginning, which won't be very noticeable if you are not using justified text.