title: Sub string in free marker not working
body: <p>I am trying to write a function which gets me the sub-string of a string stored in a variable.</p>
  
  <p>I have done the following</p>
  
  <pre><code>  &lt;#global summary_s = getSummarySubstring(activeItem, "44","")&gt;
  
  
    &lt;#function getSummarySubstring item summaryId&gt;
  
          &lt;#assign Summary = helper.getLinkedItems(item,summaryId,"")&gt;
  
          &lt;#assign SubSummary = ${Summary?substring(0,140)}&gt;
  
          &lt;#return SubSummary &gt;
  
    &lt;/#function&gt; 
  </code></pre>
  
  <p>I get a freemarker error saying:</p>
  
  <pre><code> Caused by: freemarker.core.ParseException: Encountered "{" at line 111, column 36 in 
    remoteIndexing_555_16.                                              
    Was expecting one of:
    "in" ...
     "&gt;" ...
     &lt;EMPTY_DIRECTIVE_END&gt; ...
     "." ...
    "[" ...
    "(" ...
     "?" ...
    "!" ...
     &lt;TERMINATING_EXCLAM&gt; ...
     "??" ...
     "+" ...
      "-" ...
     "*" ...
     "/" ...
     "%" ...
     "!=" ...
     "=" ...
     "==" ...
     "&gt;=" ...
     &lt;ESCAPED_GTE&gt; ...
     "&gt;" ...
  
    &lt;STRING_LITERAL&gt; ...
  </code></pre>
  
  <p>Can any body help please ?</p>