linebreaks_filter
Replace line breaks in plain text with appropriate HTML; a single
newline becomes an HTML line break (< br >) and a new line
followed by a blank line becomes a paragraph break (< /p >).
def linebreaks_filter(
value: string,
autoescape: boolean = True
) - > string
Replace line breaks in plain text with appropriate HTML; a single newline becomes an HTML line break (< br >) and a new line followed by a blank line becomes a paragraph break (< /p >).
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | The plain text content to be converted into HTML-formatted paragraphs and line breaks. |
| autoescape | boolean = True | Determines whether to escape HTML characters in the input text before processing line breaks. |
Returns
| Type | Description |
|---|---|
string | The HTML-formatted string containing paragraph and line break tags, marked as safe for template rendering. |