Why is wordpress suddenly stripping away all newline characters and how to disable this?

I found the following snippet which we can add to functions.php . I’m adding these via a plugin.

function clear_br($content) { 
return str_replace("<br>","<br clear="none">", $content);
} 
add_filter('the_content','clear_br');

Note that I’ve put "<br>" tag which is what wordpress creates when you enter newline characters.