elm.utilities.parse.replace_excessive_newlines

replace_excessive_newlines(text)[source]

Replace instances of three or more newlines with \n\n

Parameters:

text (str) – Text possibly containing many repeated newline characters.

Returns:

str – Cleaned text with only a maximum of two newlines in a row.