Author: nbubna
Date: Wed Sep 3 21:24:35 2008
New Revision: 691870
URL: http://svn.apache.org/viewvc?rev=691870&view=rev
Log:
VELOCITY-572 make escaping examples clearer
Modified:
velocity/engine/trunk/xdocs/docs/user-guide.xml
Modified: velocity/engine/trunk/xdocs/docs/user-guide.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/xdocs/docs/user-guide.xml?rev=691870&r1=691869&r2=691870&view=diff
==============================================================================
--- velocity/engine/trunk/xdocs/docs/user-guide.xml (original)
+++ velocity/engine/trunk/xdocs/docs/user-guide.xml Wed Sep 3 21:24:35 2008
@@ -745,25 +745,39 @@
Suppose that <em>$email</em> is defined (for example, if it has the
value <em>foo</em>), and that you want to output <em>$email</em>. There
are a few
ways of doing this, but the simplest is to use the escape character.
+ Here is a demonstration:
</p>
-<source><![CDATA[
-## The following line defines $email in this template:
+<source><![CDATA[## The following line defines $email in this template:
#set( $email = "foo" )
$email
\$email
-\\$email
-\\\$email
]]></source>
<p>
renders as
</p>
-<source><![CDATA[
-foo
+<source><![CDATA[foo
$email
-\foo
+]]></source>
+
+ <p>
+ If, for some reason, you need a backslash before either line above,
+ you can do the following:
+ </p>
+
+<source><![CDATA[## The following line defines $email in this template:
+#set( $email = "foo" )
+\\$email
+\\\$email
+]]></source>
+
+ <p>
+ which renders as
+ </p>
+
+<source><![CDATA[\foo
\$email
]]></source>