Transformer that supports FreeMarker legacy behavior: all newlines appearing
within the transformed area will be transformed into the platform's default
newline. Unlike the old behavior, however, newlines generated by the data
model are also converted. Legacy behavior was to leave newlines in the
data model unaltered.
Usage:
From java:
SimpleHash root = new SimpleHash();
root.put( "normalizeNewlines", new freemarker.template.utility.NormalizeNewlines() );
...
From your FreeMarker template:
<transform normalizeNewlines>
<html>
<head>
...
<p>This template has all newlines normalized to the current platform's
default.</p>
...
</body>
</html>
</transform>
version: $Id: NormalizeNewlines.java,v 1.29 2003/04/11 20:57:32 revusky Exp $ |