Wicket
  1. Wicket
  2. WICKET-2795

Wicket removes first dollar from $$ markups with TextTemplate's interpolate() while $$ are commonly used in JavaScript libraries

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.6
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
    • Environment:
      Windows XP SP3, Apache Jetty 6.1.22

      Description

      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)

        Activity

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Tuukka Mustonen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development