[
https://issues.apache.org/jira/browse/WICKET-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848907#action_12848907
]
Tuukka Mustonen edited comment on WICKET-2795 at 3/23/10 8:51 PM:
------------------------------------------------------------------
I think the point behind the escape sequence is to allow leaving ${....}
markups in templates, and that's all, no? Putting $$$$ would brake IDE support
for JavaScript (not generically, but for specific libraries).
As $variable expressions are not processed, this would be a safe thing to do.
Now:
${...} gets interpolated
$${...} gets turned into ${...}
$$ will get processed (and will result in strange results with JS calls that
have curly bracers like $$("el").each(functionI() {...}); )
After changes:
${...} gets processed
$${...} gets turned into ${...}
$$ will not get processed
Quite propably I am missing something here?
was (Author: tuukka.mustonen):
I think the point behind the escape sequence is to allow leaving ${....}
markups in templates, and that's all, no? Putting $$$$ would brake IDE support
for JavaScript (not generically, but for specific libraries).
As $variable expressions are not processed, this would be a safe thing to do.
Now:
${...} gets processed
$${...} will not get processed
$$ will get processed (and will result in strange behavior with JS calls that
have curly bracers like $$("el").each(functionI() {...}); )
After changes:
${...} gets processed
$${...} will not get processed
$$ will not get processed
Quite propably I am missing something here?
> 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.