Re: <plaintext> tag obsolete? I think not!

Benjamin Franz (snowhare@netimages.com)
Fri, 9 Jan 1998 09:32:19 -0800 (PST)


Date: Fri, 9 Jan 1998 09:32:19 -0800 (PST)
From: Benjamin Franz <snowhare@netimages.com>
To: Jamie Gerdes <jgerdes@prismrsc.com>
cc: Greg Marr <gregm@alum.wpi.edu>, www-html@w3.org
In-Reply-To: <3.0.1.32.19980109102327.007bfb00@hadji.prismrsc.com>
Message-ID: <Pine.LNX.3.96.980109084841.4409A-100000@ns.viet.net>
Subject: Re: <plaintext> tag obsolete?  I think not!

On Fri, 9 Jan 1998, Jamie Gerdes wrote:

> 
> >perl handles &lt; and &gt; just fine.
> 
> Yes, but now when you need to print out repeated lines using something like...
> 
> STDOUT = 
> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<
> $name,                                       $email
> .
> 
> Because once you substitute the < and > with &lt; and &gt; it takes up 4
> spaces (4 of your @<<< spaces) instead of just one.
> 
> So the text   "<jamie>"  would fit in the field  "@<<<<<<", but
> "&lt;jamie&gt;" would not.
> 
> That's my dilemma.

for($count=0;$count<$lastline;$count++) {
        $name=$name[$count];
        $email=$email[$count];
        print (&PadToLength($name,45),&PadToLength($email,10),"\n");
}
print "\n";

sub PadToLength {
        my ($string,$maxsize)=@_;
        my ($padding);

        $string = substr($string,0,$maxsize);
        $padding = " " x ($maxsize - length($string));
        $string=&htmlize($string) . $padding;
        $string;
}

sub htmlize {
        my($string)=@_;

        $string=~s/\&/\&amp;/osg;
        $string=~s/</\&lt;/osg;
        $string=~s/>/\&gt;/osg;
        $string=~s/"/\&quot;/osg;

        $string;
}


Write your own formatting routine instead of depending on Perl's. Or
convert *everything* to three digit numeric entities. Or use tables. Or
use printf and tweek the format string on the fly. Or....

The point is that what you are complaining about is not an HTML problem
but an implementation problem in your code. One that *is* solvable and
does not require <PLAINTEXT>.

-- 
Benjamin Franz