Skip to main content

linebreaks

Convert newlines into < p > and < br >s.

def linebreaks(
value: string,
autoescape: boolean = False
) - > string

Convert newlines into < p > and < br >s.

Parameters

NameTypeDescription
valuestringThe raw text content containing newlines to be formatted into HTML.
autoescapeboolean = FalseWhether to escape HTML special characters in the input text before wrapping in tags.

Returns

TypeDescription
stringThe input text wrapped in HTML paragraph tags with single newlines converted to line break tags.