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

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