This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 717 - Shown source loses indentation
Summary: Shown source loses indentation
Status: VERIFIED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.6.5
Hardware: Other other
: P2 normal
Target Milestone: 0.6.6
Assignee: Ville Skyttä
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-15 05:46 UTC by Ville Skyttä
Modified: 2004-05-17 22:04 UTC (History)
1 user (show)

See Also:


Attachments
Candidate fix for preserving source indentation (1.51 KB, patch)
2004-05-15 05:47 UTC, Ville Skyttä
Details
More small show source tweaks (1.00 KB, patch)
2004-05-16 06:20 UTC, Ville Skyttä
Details

Description Ville Skyttä 2004-05-15 05:46:48 UTC
There are many reports on www-validator@ about this.  Will attach a patch which
works4me, tested with Firefox, Konqueror, and Opera on Linux.
Comment 1 Ville Skyttä 2004-05-15 05:47:50 UTC
Created attachment 365 [details]
Candidate fix for preserving source indentation
Comment 2 Terje Bless 2004-05-16 03:19:19 UTC
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.
Comment 3 Ville Skyttä 2004-05-16 06:20:56 UTC
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.
Comment 4 Ville Skyttä 2004-05-17 17:41:14 UTC
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.
Comment 5 Terje Bless 2004-05-17 17:59:58 UTC
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.
Comment 6 Ville Skyttä 2004-05-17 18:04:21 UTC
Definitely not a big issue, thanks for the explanation.