[ 
https://issues.apache.org/jira/browse/WICKET-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849099#action_12849099
 ] 

Tuukka Mustonen commented on WICKET-2795:
-----------------------------------------

Oh that's quite true, I didn't think it through.

Then, backslashes are commonly interpreted as 
ignore-the-next-character's-special-meaning and everyone knows about them 
already - was there some special reason for not selecting them for this as well 
so \$ for turning into $ and \\$ for turning into \$ and so on?

> Wicket removes first dollar from $$ markups with TextTemplate's interpolate() 
> while $$ are commonly used in JavaScript libraries
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2795
>                 URL: https://issues.apache.org/jira/browse/WICKET-2795
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>         Environment: Windows XP SP3, Apache Jetty 6.1.22
>            Reporter: Tuukka Mustonen
>            Assignee: Igor Vaynberg
>
> Many JavaScript libraries such as jQuery and MooTools use $$ to find out 
> arrays of elements. Having $$('blaa') is currently replaced by Wicket into 
> $('blaa'). Wanted behavior is to replace all $${...} with ${...}, not $$ with 
> $.
> Possible fix (don't really have time to look at this atm):
> org.apache.wicket.util.template.VariableInterpolator:
> Row 111:
>               while ((start = lowerPositive(string.indexOf("$$", pos), 
> string.indexOf("${", pos))) != -1)
>               {
>                       // Append text before possible variable
>                       buffer.append(string.substring(pos, start));
>                       if (string.charAt(start + 1) == '$')
>                       {
>                               buffer.append("$");
>                               pos = start + 2;
>                               continue;
>                       }
>               ...
> Shoud be changed to:
>               while ((start = lowerPositive(string.indexOf("$${", pos), 
> string.indexOf("${", pos))) != -1)
>               {
>                       // Append text before possible variable
>                       buffer.append(string.substring(pos, start));
>                       if (string.charAt(start + 1) == '$' && 
> string.charAt(start + 2) == '{')
>                       {
>                               buffer.append("${");
>                               pos = start + 3;
>                               continue;
>                       }
>               ...
> (no JIRA markup for rich formatting available? uh)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to