perl -0 -pe '1 while (s/(
\n.*?)\n(.*<\/pre>)/$1

\n$2/ms);s/<\/?pre>//g' htmlfile