[Seaside] sexprs, newlines and brs .. is this a bug?

Ragnar Hojland Espinosa seaside@lists.squeakfoundation.org
Fri, 2 Aug 2002 11:50:15 +0200


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Aug 01, 2002 at 10:17:06AM -0700, Avi Bryant wrote:
> On Thu, 1 Aug 2002, Ragnar Hojland Espinosa wrote:
> 
> > This works fine
> >
> > 	    descr _ '<hello world>'.
> >
> > as in #html, the [descr] <> chars are correctly escaped.  However, I have a
> > multiline variable, with some newlines.  Shouldnt they get escaped to <BR>s?
> 
> That's a good question.  You're probably right - do you want to submit a
> patch to String>>seaEscapeHtml?  Or just file a bug report at
> bugs.beta4.com and I'll get around to it.

Changed the newline to <BR> in the attached file.
-- 
Ragnar Hojland - Project Manager
Linalco "Especialistas Linux y en Software Libre"
Tel: +34-91-5970074 Fax: +34-91-5970083

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: attachment; filename="String-seaEscapeHtml.st"
Content-Transfer-Encoding: quoted-printable

'From Squeak 3.2 of 11 July 2002 [latest update: #4917] on 2 August 2002 at=
 11:45:58 am'!=0D=0D!String methodsFor: 'seaside' stamp: 'RHE 8/2/2002 11:4=
3'!=0DseaEscapeHtml=0D
	| stream entities|=0D
	entities _ 	#('' '=01' '=02' '=03' '=04' '=05' '=06' '=07' '=08' '	' '' '=
=0B' '=0C' '<br>' '=0E' '=0F' '=10' '=11' '=12' '=13' '=14' '=15' '=16' '=
=17' '=18' '=19' '=1A' '=1B' '=1C' '=1D' '=1E' '=1F' ' ' '!!' '"' '#' '$' '=
%' '&amp;' '''' '(' ')' '*' '+' ',' '-' '.' '/' '0' '1' '2' '3' '4' '5' '6'=
 '7' '8' '9' ':' ';' '&lt;' '=3D' '&gt;' '?' '@' 'A' 'B' 'C' 'D' 'E' 'F' 'G=
' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' '=
Z' '[' '\' ']' '^' '_' '`' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' =
'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' '{' '|' '}' '~' '=
=7F' '&Auml;' '&Aring;' '&Ccedil;' '&Eacute;' '&Ntilde;' '&Ouml;' '&Uuml;' =
'&aacute;' '&agrave;' '&acirc;' '&auml;' '&atilde;' '&aring;' '&ccedil;' '&=
eacute;' '&egrave;' '&ecirc;' '&euml;' '&iacute;' '&igrave;' '&icirc;' '&iu=
ml;' '&ntilde;' '&oacute;' '&ograve;' '&ocirc;' '&ouml;' '&otilde;' '&uacut=
e;' '&ugrave;' '&ucirc;' '&uuml;' '&sup1;' '&deg;' '&cent;' '&pound;' '&sec=
t;' '=82' '&para;' '&szlig;' '&reg;' '&copy;' '=8E' '&acute;' '&uml;' '&shy=
;' '&AElig;' '&Oslash;' '=8D' '&plusmn;' '&sup2;' '&sup3;' '&yen;' '&micro;=
' '&brvbar;' '&middot;' '&cedil;' '&nbsp;' '&frac14;' '&ordf;' '&ordm;' '&f=
rac12;' '&aelig;' '&oslash;' '&iquest;' '&iexcl;' '&not;' '=92' '=80' '=81'=
 '=8C' '&laquo;' '&raquo;' '=83' '&frac34;' '&Agrave;' '&Atilde;' '&Otilde;=
' '=91' '=93' '&ETH;' '=84' '=96' '=94' '=95' '=90' '&divide;' '&times;' '&=
yuml;' '&Yacute;' '=98' '=97' '=86' '=99' '&THORN;' '&curren;' '=88' '=87' =
'=89' '=8B' '=8A' '&Acirc;' '&Ecirc;' '&Aacute;' '&Euml;' '&Egrave;' '&Iacu=
te;' '&Icirc;' '&Iuml;' '&Igrave;' '&Oacute;' '&Ocirc;' '&eth;' '&Ograve;' =
'&Uacute;' '&Ucirc;' '&Ugrave;' '=9B' '=9A' '=85' '=8F' '=9D' '=9C' '=9E' '=
=9F' '&yacute;' '&thorn;' '&hibar;').=0D
		=0D
	stream _ WriteStream on: String new.=0D
	self do: [:c| stream nextPutAll: (entities at: c asciiValue + 1)].			=0D
						=0D
	^ stream contents asString! !=0D
--sm4nu43k4a2Rpi4c--