jinja2.lexer.count_newlines

jinja2.lexer.count_newlines(value)[source]

Count the number of newline characters in the string. This is useful for extensions that filter a stream.