Merge pull request #132 from maximebochon/patch-3
README: use HTML code blocks for HTML examples
This commit is contained in:
@@ -409,31 +409,37 @@ Newline trimming
|
|||||||
If the opening or closing section tag are the only thing on a line, any surrounding whitespace and
|
If the opening or closing section tag are the only thing on a line, any surrounding whitespace and
|
||||||
the line terminator following the tag are trimmed. This allows for civilized templates, like:
|
the line terminator following the tag are trimmed. This allows for civilized templates, like:
|
||||||
|
|
||||||
Favorite foods:
|
```html
|
||||||
<ul>
|
Favorite foods:
|
||||||
{{#people}}
|
<ul>
|
||||||
<li>{{first_name}} {{last_name}} likes {{favorite_food}}.</li>
|
{{#people}}
|
||||||
{{/people}}
|
<li>{{first_name}} {{last_name}} likes {{favorite_food}}.</li>
|
||||||
</ul>
|
{{/people}}
|
||||||
|
</ul>
|
||||||
|
```
|
||||||
|
|
||||||
which produces output like:
|
which produces output like:
|
||||||
|
|
||||||
Favorite foods:
|
```html
|
||||||
<ul>
|
Favorite foods:
|
||||||
<li>Elvis Presley likes peanut butter.</li>
|
<ul>
|
||||||
<li>Mahatma Gandhi likes aloo dum.</li>
|
<li>Elvis Presley likes peanut butter.</li>
|
||||||
</ul>
|
<li>Mahatma Gandhi likes aloo dum.</li>
|
||||||
|
</ul>
|
||||||
|
```
|
||||||
|
|
||||||
rather than:
|
rather than:
|
||||||
|
|
||||||
Favorite foods:
|
```html
|
||||||
<ul>
|
Favorite foods:
|
||||||
|
<ul>
|
||||||
|
|
||||||
<li>Elvis Presley likes peanut butter.</li>
|
<li>Elvis Presley likes peanut butter.</li>
|
||||||
|
|
||||||
<li>Mahatma Gandhi likes aloo dum.</li>
|
<li>Mahatma Gandhi likes aloo dum.</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
```
|
||||||
|
|
||||||
which would be produced without the newline trimming.
|
which would be produced without the newline trimming.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user