Perl one-liner for adding newlines to HTML
When the rich editor puts all HTML in one line, and I want to edit it, I could always use the “tidy” utility, however it does too much. All I want is a newline here and there to make the whole thing accessible.
So this simple one-liner does the job:
perl -pe 's/(<\/(?:p|h\d|div|tr|td|table|ul|ol|li)>)/"$1\n"/ge'
Not perfect, but gives something to work with.