Forum Moderators: open

Message Too Old, No Replies

Indentation

please

         

RonPK

12:25 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the previous version of this board's software two whitespace characters would be replaced in the output by one whitespace character. So if I typed four whitespaces inside a \[code\] block, the message would be printed with two spaces. That enabled some sort of indentation, albeit it primitive.

The current version is much tougher on whitespaces. The trick above doesn't work anymore. Is there a different way to achieve indentation? Needless to say (I hope) that postings with code in them would become much easier to read. Think of CSS, HTML, JavaScript, PHP. Even Perl might become readable ;)

eelixduppy

2:45 pm on Jul 18, 2006 (gmt 0)



I believe using pre will solve your prpblem. The following is with pre:

<?php
if($var = "fish") {
echo "YAY, we are having fish for dinner!"; (6 space indent)
} else {
echo "Booo...No fish"; (6 space indent)
}
?>

RonPK

3:27 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thx eelixduppy. Why didn't I think of that...

pixeltierra

6:04 am on Jul 19, 2006 (gmt 0)

10+ Year Member




1
2
3
4
5

just testing... doesn't seem to do much

pixeltierra

6:06 am on Jul 19, 2006 (gmt 0)

10+ Year Member



didnt' work

Should I be using a < pre >
or a [ pre ]

also should it be on every line, or around multiple lines?

engine

11:51 am on Jul 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I presume you guys found [webmasterworld.com...]

Brett_Tabke

12:52 pm on Jul 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That is also going to go away RonPK, eelixduppy. It was just an oversight.

Something has to be done to clean all the extra spaces out of posts from some browsers. I don't see anyway short of allowing people to spam the db, than ripping out the spaces.

There isn't accidently a php code beautification routine written in perl is there?

perl example of perl syntax highlighting on the fly:
[sedition.com...]

[perl]$thisprogram = $threadprogram;
&AccessCheck;

#-----------------------:

$ua3 =$ENV{'HTTP_USER_AGENT'};

$inforum = $FORM{'forum'};
$inkeyword = $FORM{'keyword'};
$inthreadid = $FORM{'discussion'};

if ($inthreadid =~ /\-/) {
($inthreadid,$section,$tsplitcnt) = split(/-/,$inthreadid);
}
$section--;
$section =0 if $section <0;

$tsplitcnt =$threadsplitcnt;
#$threadsplitcnt =30 if $threadsplitcnt <30;
#$threadsplitcnt =70 if $threadsplitcnt >70 && ($sysop ne $LIU);
$prefsdirty++ if $tsplitcnt!= $threadsplitcnt;
$tsplitcnt =$threadsplitcnt;

$StartMessage =($section * $threadsplitcnt)+1 if $section;
$EndMessage =$StartMessage + $threadsplitcnt;

&GetKeywordForumHeader($inkeyword) if length($inkeyword);
&GetForumHeader($inforumid) if!length($inkeyword);

$threaddat = "$ForumsData/$DirPrefix$inforumid/$inthreadid.cat";
$tlog = "forum$inforum/$inthreadid.htm";

&GoHighlight if!$highlight;
$ValidMember =0 if exists $prefs{"$LIU-access-validated"};[/perl]