updated the book to describe the new paragraphbreaks filter

This commit is contained in:
mbuscemi 2021-03-22 03:59:17 -07:00 committed by Dirkjan Ochtman
parent e018c4a427
commit 4ca966178c

View File

@ -162,6 +162,24 @@ Output:
hello<br />world<br /><br />from<br />askama
```
### paragraphbreaks
A new line followed by a blank line becomes `<p>`, but, unlike `linebreaks`, single new lines are ignored and no `<br/>` tags are generated.
Consecutive double line breaks will be reduced down to a single paragraph break.
This is useful in contexts where changing single line breaks to line break tags would interfere with other HTML elements, such as lists and nested `<div>` tags.
```
{{ "hello\nworld\n\nfrom\n\n\n\naskama"|paragraphbreaks }}
```
Output:
```
<p>hello\nworld</p><p>from</p><p>askama</p>
```
### lower | lowercase
Converts to lowercase.