Skip to content

Commit

Permalink
use more consisten explanation for whitespace trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 14, 2014
1 parent 710e8c7 commit 5eec227
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 5 additions & 4 deletions lib/Mojo/Template.pm
Expand Up @@ -373,6 +373,11 @@ L<Mojo::ByteStream> objects are always excluded from automatic escaping.
% use Mojo::ByteStream 'b';
<%= b('<div>excluded!</div>') %>
Whitespace characters around tags can be trimmed by adding an additional equal
sign to the end of a tag.
<%= All whitespace characters around this expression will be trimmed =%>
Newline characters can be escaped with a backslash.
This is <%= 1 + 1 %> a\
Expand All @@ -385,10 +390,6 @@ backslash.
in multiple\\
lines
Whitespace characters around tags can be trimmed with a special tag ending.
<%= All whitespace characters around this expression will be trimmed =%>
You can capture whole template blocks for reuse later with the C<begin> and
C<end> keywords.
Expand Down
15 changes: 7 additions & 8 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -117,6 +117,13 @@ Only L<Mojo::ByteStream> objects are excluded from automatic escaping.

<%= b('<p>test</p>') %>

Whitespace characters around tags can be trimmed by adding an additional equal
sign to the end of a tag.

<% for (1 .. 3) { %>
<%= 'trim all whitespace characters around this expression' =%>
<% } %>

Newline characters can be escaped with a backslash.

This is <%= 1 + 1 %> a\
Expand All @@ -129,14 +136,6 @@ backslash.
in multiple\\
lines

You can also add an additional equal sign to the end of a tag to have it
automatically remove all surrounding whitespace, this allows you to freely
indent your code without ruining the result.

<% for (1 .. 3) { %>
<%= $foo =%>
<% } %>

Stash values that don't have invalid characters in their name get
automatically initialized as normal variables in the template, and the
controller object as both C<$self> and C<$c>.
Expand Down

0 comments on commit 5eec227

Please sign in to comment.