You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2007/02/05 06:08:15 UTC

Re: Should @Insert encode whitespace?

I don't remember which version this affected but I did fix a minor
whitespace issue in the template parser a few weeks ago. (I have no
idea, just know it's probably in >= 4.1.1 - it was related to i18n but
may be applicable to your situation )

On 1/30/07, Wes Bramhall <We...@widen.com> wrote:
> I have an app that displays a list of filenames to the user. I'm looping
> over a list of File objects and displaying the names using an insert
> component. Here's a barebones example:
>
> <files jwcid="@For" source="ognl:files" value="ognl:loopFile">
>         <filename jwcid="@Insert" value="ognl:loopFile.name" /><br />
> </files>
>
> It is possible to have filenames like "A  B", "A   B", and "A    B".
> Sent to the insert component, they get rendered as "A  B", "A   B", and
> "A    B" in the HTML source but end up displayed as "A B", "A B", and "A
> B" on the screen. Setting the raw attribute to true doesn't change this
> behavior. Would it be reasonable to encode consecutive spaces as &nbsp;?
> Does anyone have a better idea?
>
>
> For now I'll have to switch to the below code:
>
> <files jwcid="@For" source="ognl:files" value="ognl:loopFile">
>         <filename jwcid="@Insert" raw="ognl:true" value="ognl:safeName"
> /><br />
> </files>
>
> public String getSafeName()
> {
>         return getLoopFile().getName().replace(" ", "&nbsp;");
> }
>
> Thanks,
> -Wes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org