This indeed seems like a bug, here is test I just wrote:
[Test]
public void EscapeNewLine()
{
    Assert.AreEqual(@"1:title=<Text\nMoreText>",
Eval(@"%{title='Text\\nMoreText'}"));
}

I haven't got time at the moment to try to trace down why this is happening,
you are more than welcome to though.

A workaround is to set a variable to the combined string and use the
variable in the dictionary.

Are you sure you want to put a "\n" into a title attribute, because IIRC
only IE consistently supports converting this into a new line. You may be
better off using one of the javascript solutions.

On Sun, Dec 6, 2009 at 12:13 AM, Ola Herrdahl <[email protected]> wrote:

> Hi all,
>
> This is probably a simple one.
>
> How do you escape backslash (\) when using the nvelocity dictionary
> improvement?
>
> I need to include \n in the title tag of a generater link, something like
> this (using the MonoRail UrlHelper):
>
> Url.Link(.., "%{title='$user.Name\n$student.UserName'}")
>
> This renders into
>
> <a ... title="MyName
>
> MyUserName>
>
>
> But I need it to render into
>
> <a ... title="MyName\nMyUserName>
>
>
> Trying to escape it the common way (\\n) renders into
>
> \
>
>
>>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>



-- 
Jono

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


Reply via email to