1 (edited by Alrescha 2004-04-25 09:24)

Topic: letter-spacing and the disappearing br

With multiple multiline paragraphs, the defaul style displays the br's correctly and gives the appearance of paragraphing. But when I add into .puntext the letter-spacing: 1px; statement, the br's disappear and paragraphcs stick to one another.

(I need to space out the individual characters slightly, otherwise with PunBB's default style settings, Chinese content are a pain to read.)

Any pointers would be appreciated.

PS: I thought the tags must be <br /> to be validated? The source that 1.1.3 produces use only <br>.

2 (edited by Paul 2004-04-25 19:30)

Re: letter-spacing and the disappearing br

This is a known IE bug. What happens is that when letter spacing is set the second <br> fails to render. If you have a look in Mozilla you should find that things works normally; at least they did when I tried it. I will have a look round the usual places and see if anybody has an easy fix for this.

You are right about the <br> tag and, I believe, they will be fixed for the next major release which will validate as XHTML.

EDIT.

Didn't need to look after all, just think. This is not particularly elegant as a solution but it does work.
Go to line 312 in parser.php and change it to this

$replace = array('<span style="letter-spacing:normal"><br></span>', '    ', '  ', '  ');

All this bit of code actually does is turn letter spacing off before the <br> tags are rendered and then it is turned back on again for the next line of text. You can also solve the problem using a non-breaking space but this will result in indented text.

You may have to make other adjustments in parser.php, infact wherever you see two <br> tags used. The method is the same in all cases though, just wrap them in a span which sets letter-spacing:normal.

Re: letter-spacing and the disappearing br

Thanks very much! It's working nicely now. I think I'll start testing style problems in Mozilla as well. big_smile