Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swallow leading whitespace before template tags
this makes it easier to write templates without introducing, or needing to think about, leaving leading whitespace lying arounswallow leading whitespace before template tags this makes it easier to write templates without introducing, or needing to think about, leaving leading whitespace lying aroundd
- Loading branch information
Showing
5 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/test_app/TestApp/Template/Bake/view_tests/leading-whitespace.ctp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% foreach([1,2,3] as $number): %> | ||
<%= $number %> | ||
<% endforeach; %> | ||
|
||
<% foreach([1,2,3] as $number): %> | ||
number | ||
<% endforeach; %> | ||
|
||
This should make no difference: | ||
<% foreach([1,2,3] as $number): %> | ||
<%= $number %> | ||
<% endforeach; %> | ||
And the previous line should not have leading whitespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
There should be a newline about here: <%= "" %> | ||
And this should be on the next line. | ||
|
||
There should be no new line after this<%= "" %> |
13 changes: 13 additions & 0 deletions
13
tests/test_app/TestApp/Template/Bake/view_tests_compare/leading-whitespace.ctp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
1 | ||
2 | ||
3 | ||
|
||
number | ||
number | ||
number | ||
|
||
This should make no difference: | ||
1 | ||
2 | ||
3 | ||
And the previous line should not have leading whitespace. |