fix the 'Format' button on lisppaste /display/ page
restore code for formatting pastes with line numbers

commit that changed the code described it as an optimization but
it apparently depends on a version of html-encode that is no
longer available, so only using the old code when line numbers
are requested