Prevent phpBB 'code' tag from eating leading spaces?

Opinions, ideas and thoughts about Nekochan Net.
User avatar
stuart
Posts: 912
Joined: Mon Aug 23, 2004 5:37 pm
Location: Cambridge, UK
Contact:

Prevent phpBB 'code' tag from eating leading spaces?

Unread postby stuart » Thu Jan 31, 2008 4:24 am

As noted here, phpBB's 'code' tag removes any leading spaces from a line - which, for code, is almost definitely not what's wanted.

Is there any phpBB setting which can be hacked/changed to preserve all line-spacing within 'code' tags?

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Prevent phpBB 'code' tag from eating leading spaces?

Unread postby ShadeOfBlue » Thu Jan 31, 2008 5:30 am

It seems to work fine here (Safari 3.0.4) ...

Code: Select all

. -> no leading spaces
  . -> 2 spaces
    . -> 4
        . -> 8
                . -> 16


What browser are you using? It's possible it doesn't have support for the CSS white-space property or that it in some way alters the text you enter.

User avatar
stuart
Posts: 912
Joined: Mon Aug 23, 2004 5:37 pm
Location: Cambridge, UK
Contact:

Re: Prevent phpBB 'code' tag from eating leading spaces?

Unread postby stuart » Thu Jan 31, 2008 10:37 am

Interesting - I can see spaces in your reply...

I pasted in the output from 'diff' in the post above (http://forums.nekochan.net/viewtopic.php?f=15&t=16878) with neko_firefox-2.0.0.11, and I can't see any leading spaces!

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8145
Joined: Thu Jan 23, 2003 1:31 am
Location: Pleasanton, California
Contact:

Re: Prevent phpBB 'code' tag from eating leading spaces?

Unread postby nekonoko » Thu Jan 31, 2008 1:41 pm

I haven't noted any problems with it either - otherwise all of the 'hinv' outputs would look funny, and they're all fine.
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
stuart
Posts: 912
Joined: Mon Aug 23, 2004 5:37 pm
Location: Cambridge, UK
Contact:

Re: Prevent phpBB 'code' tag from eating leading spaces?

Unread postby stuart » Thu Jan 31, 2008 4:36 pm

It must be something about the characters in the text, then (the troffrc file does tend to look like line-noise ;) ) - I've just re-edited the post with Safari, and the message body definitely contains leading spaces... which the rendered version definitely doesn't.

So there's definitely something wrong here - but it's something which doesn't affect hinv posts or SOB's post above.

Code: Select all

. <- test 0
. <- test 0
 . <- test 1
 . <- test 1
  . <- test 2
  . <- test 2


Ah-ha! There we go! Single spaces at the start of lines in code blocks are being dropped!


Return to “Nekochan Net”

Who is online

Users browsing this forum: No registered users and 1 guest