README: use HTML code blocks for HTML examples

This commit is contained in:
Maxime BOCHON
2022-02-14 16:19:50 +01:00
committed by GitHub
parent 5392256ddc
commit c9ba5e8946
+25 -19
View File
@@ -409,31 +409,37 @@ Newline trimming
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:
Favorite foods:
<ul>
{{#people}}
<li>{{first_name}} {{last_name}} likes {{favorite_food}}.</li>
{{/people}}
</ul>
```html
Favorite foods:
<ul>
{{#people}}
<li>{{first_name}} {{last_name}} likes {{favorite_food}}.</li>
{{/people}}
</ul>
```
which produces output like:
Favorite foods:
<ul>
<li>Elvis Presley likes peanut butter.</li>
<li>Mahatma Gandhi likes aloo dum.</li>
</ul>
```html
Favorite foods:
<ul>
<li>Elvis Presley likes peanut butter.</li>
<li>Mahatma Gandhi likes aloo dum.</li>
</ul>
```
rather than:
Favorite foods:
<ul>
<li>Elvis Presley likes peanut butter.</li>
<li>Mahatma Gandhi likes aloo dum.</li>
</ul>
```html
Favorite foods:
<ul>
<li>Elvis Presley likes peanut butter.</li>
<li>Mahatma Gandhi likes aloo dum.</li>
</ul>
```
which would be produced without the newline trimming.