Skip to content

Releases: google/escapevelocity

EscapeVelocity 1.1

18 Jan 22:02
Compare
Choose a tag to compare

Several Velocity features are newly supported:

  • Macro invocation like #@foo() ... #end, where the ... is available in the body of the foo macro as $bodyContent. (bc4ab4a)
  • The #break directive, though #break($foreach.parent) remains unsupported. (014eb69)
  • The #evaluate directive. (bec0a84)
  • The #define directive. (18d40b1)
  • We now allow both #foreach ($x in ...) and #foreach (${x} in ...). (3695313)

Also:

  • Two bugs with space deletion before #set have been fixed, to be more like Apache Velocity. (7ab4397, 5158d55)
  • We no longer suggest wrapping your template Reader in a BufferedReader, since in fact that is unnecessary. (52d0a52)

EscapeVelocity 1.0

28 Dec 22:41
Compare
Choose a tag to compare

Many changes for greater compatibility with Apache Velocity 1.7.

  • #parse directives now take effect when the containing template is evaluated rather than when it is parsed. That means that the argument no longer has to be a constant string. (f34d95b)
  • An unrecognized #directive is now ignored rather than causing an exception. (a0ae2ba)
  • The $foreach variable, defined in #foreach loops, now supports $foreach.count, $foreach.first, and $foreach.last, in addition to .hasNext and .index which were already supported. (0c7d704)
  • String concatenation with + is now supported. (String interpolation was already supported.) (c6e256a)
  • The words and, or, not can be used as synonyms for &&, ||, ! respectively. (d2c4514)
  • Added support for list and range literals, [1, 2, 3] and [1..100]. (7b2e154)
  • The handling of whitespace before #set is now closer to (and perhaps identical to) Velocity's. (ebf6a94)
  • Null-handling is more like Velocity, in particular with the $!foo syntax. (6e2a874)

EscapeVelocity 0.9.1

01 Jul 21:15
Compare
Choose a tag to compare

Added more features for closer compatibility with Apache Velocity 1.7.

  • $foreach.index in addition to the existing $foreach.hasNext.

  • Strings with single quotes 'foo' in addition to the existing double quotes "foo". Also, within double quotes (but not single ones) references are expanded, as in "Impl_$p".

  • Commas are optionally allowed between parameters in macro calls. The Velocity documentation doesn't mention this but the implementation allows it.

  • It is not an error if a block comment #* is not closed before the end of the file, again consistently with Velocity.

  • $map.key is equivalent to $map["key"] when $map is a java.util.Map.

  • Static methods can be called on Class objects. For example, if $Thread has been set equal to java.lang.Thread.class then $Thread.yield() is a valid method call.

Also, optimized method lookup for references like $foo.bar(). This makes template evaluation twice as fast on some benchmarks.

EscapeVelocity 0.9

07 Jun 00:04
Compare
Choose a tag to compare

This is the initial release. Previously this code was part of AutoValue, where it has existed for several years.