Thread: [htmltmpl] escape html whitespace
Brought to you by:
samtregar
From: Matt T. <mt...@as...> - 2007-03-30 16:41:03
|
I couldn't find this information in the archive... I like the ESCAPE options (HTML, URL, JS). Is there a way to also escape whitespace? In particular, I would like an easier way to replace spaces with Currently looping through data from dbi and replacing. Any ideas? Matt |
From: Sam T. <sa...@tr...> - 2007-03-30 22:22:06
|
On Fri, 30 Mar 2007, Matt Taylor wrote: > I couldn't find this information in the archive... > > I like the ESCAPE options (HTML, URL, JS). > > Is there a way to also escape whitespace? In particular, I would like > an easier way to replace spaces with > > Currently looping through data from dbi and replacing. Any ideas? Don't do that? really shouldn't be needed in modern HTML layout. Maybe you can show us what you're using it for and we can suggest a better way? -sam |
From: Mathew R. <mat...@ne...> - 2007-04-01 23:01:32
|
>> I couldn't find this information in the archive... >> >> I like the ESCAPE options (HTML, URL, JS). >> >> Is there a way to also escape whitespace? In particular, I would like >> an easier way to replace spaces with >> >> Currently looping through data from dbi and replacing. Any ideas? >> > > Don't do that? really shouldn't be needed in modern HTML > layout. Maybe you can show us what you're using it for and we can > suggest a better way? > Hi Sam, One of the mods that I made to my local copy of H::T was to allow the ESCAPE modules to be dynamically loadable so that users could implement escaping according to whatever rules they had. Would you be interested in a patch to allow this feature? Mathew |
From: Matt T. <mt...@as...> - 2007-04-02 14:40:15
|
Thanks for the quick reply. This question may be beyond the scope of this mailing list, but... I am pulling data from a database view that adds spaces to create alignment. For example: * AZ300~30ST Full-Width Std Thic AZ300~18ST Full-Width Std Thic * AZ360HD~36HD 20in Tandem St AZ360HD~20HD 20in Tandem St AZ360HD~24Z 20in Tandem St I am replacing the leading spaces before writing the data to a select box's option tag. I tried adding style="white-space: pre;" to the option tag, but that made all the new line characters show up. I tried putting a div tag, with style="white-space: pre;" around the contents of the option tag. That didn't have any effect. <select name="partid"> <option value="AZ300R2F3S2"> <div style="white-space: pre;">* AZ300~30ST Full-Width Std Thic (AZ300R2F3S2)</div> </option> <option value="X000564"> <div style="white-space: pre;"> AZ300~18ST Full-Width Std Thic (X000564)</div> </option> </select> I am sure there are other solutions, but is the first thing that came to mind. Matt On Fri, 2007-03-30 at 18:22 -0400, Sam Tregar wrote: > On Fri, 30 Mar 2007, Matt Taylor wrote: > > > I couldn't find this information in the archive... > > > > I like the ESCAPE options (HTML, URL, JS). > > > > Is there a way to also escape whitespace? In particular, I would like > > an easier way to replace spaces with > > > > Currently looping through data from dbi and replacing. Any ideas? > > Don't do that? really shouldn't be needed in modern HTML > layout. Maybe you can show us what you're using it for and we can > suggest a better way? > > -sam |