From 4ca966178c63bac1b6a803f2dc74bd43f27dcf24 Mon Sep 17 00:00:00 2001 From: mbuscemi Date: Mon, 22 Mar 2021 03:59:17 -0700 Subject: updated the book to describe the new paragraphbreaks filter --- book/src/filters.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'book') diff --git a/book/src/filters.md b/book/src/filters.md index 2dc27b5..bbeb5b8 100644 --- a/book/src/filters.md +++ b/book/src/filters.md @@ -162,6 +162,24 @@ Output: hello
world

from
askama ``` +### paragraphbreaks + +A new line followed by a blank line becomes `

`, but, unlike `linebreaks`, single new lines are ignored and no `
` 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 `

` tags. + +``` +{{ "hello\nworld\n\nfrom\n\n\n\naskama"|paragraphbreaks }} +``` + +Output: + +``` +

hello\nworld

from

askama

+``` + ### lower | lowercase Converts to lowercase. -- cgit