This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
There are many reports on www-validator@ about this. Will attach a patch which works4me, tested with Firefox, Konqueror, and Opera on Linux.
Created attachment 365 [details] Candidate fix for preserving source indentation
Applied a modified version of that patch. Take look and see that I didn't goof up anywhere Ville? I note that the line numbers aren't lining up for some reason. Since it's annoying but not critical I didn't bother spending more time on it right now.
Created attachment 366 [details] More small show source tweaks Still works for me mostly. Attached is a few more tweaks: - Remove line break after <pre> and whitespace before </pre> to avoid unwanted "padding" inside the source code box. - Use <a id="..." name="..."> compatibility bloat since we're using it elsewhere as well.
Nitpickery and micro tuning: the "no newline after <pre>" and "no whitespace before </pre>" changes from attachment 366 [details] were lost when applying this, it seems. Just confirming if that was intentional or not... some browsers tend to add unwanted blank lines in these cases as was mentioned in comment 3.
Ah, sorry, I'd meant to remark on that. I deliberately dropped that bit of the patch. It made the code slightly uglier and I really don't see any problem with the whitespace at the beginning/end of the <pre/ > section. If browsers decide to show an extra blank line then that's just a little extra "air" in addition to the padding we set explicitly. If you feel strongly about it then just change it in CVS.
Definitely not a big issue, thanks for the explanation.