in reply to Re^3: <pre> vs. <code> tags ("wide")
in thread <pre> vs. <code> tags

Ok, so is 24 the authoritative number? If so, the part of the footnote 1 on Perl Monks Approved HTML tags which says

"... and please use <code> instead of <pre> unless the enclosed lines are pretty short."

could be modified to read something like

"... and please use <code> instead of <pre> unless the enclosed lines are less than 24 characters wide (as they typically won't be wrapped by browsers). Don't use <pre> at all if the reply level of the node in question is deeper than 4."

That would be a pretty minor change, and hopefully, clearly telling people what the rules are will avoid having to "beat" them to it (though admittedly, that might work only with the more civilised ones).   In case 24 isn't ok either, we should probably do away with <pre> altogether...

It wouldn't be particularly hard to parse <pre> blocks and re-render them as things that use fixed-width fonts and preserve whitespace but also are willing to wrap.

Until that is done, would it be ok if I enclose such sections in <p><tt>...</tt></p>, adding <br /> at the end of every line, and replacing every other space with &nbsp; in stretches of consecutive spaces? (<tt> doesn't preserve whitespace)  At least in Firefox that seems to render as intended. Any better suggestions how to highlight stuff in preformatted sections?

(BTW, it will always be a mystery to me why browsers on small-screen devices don't allow you to configure something like "forced wrap" for preformatted sections...  But that's another issue.)