Re: Tidy [Inferred Table] Bug
Charlie Reitzel <[email protected]> Tue, 24 Nov 2009 10:23:24 -0500
| Newsgroups | gmane.comp.web.html-tidy.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Ger, I have been following this thread only in a general sense. But it looks like you all are on a good track. Keep it going! I also take your point about browser rendering. As it happens, I have always used Tidy pretty much as you do. Personally, mod_tidy seems like not such a great idea. Tidy was never so good at what it does that a person shouldn't clean up after it sometimes. I always applied it at the front end. I.e. When content is submitted to a CMS, not at display time. That said, for better or worse, browser rendering is actually the official reference. Way back, when we first started the project, discussions for alternative "edits" would come up again and again. It did become a more or less official guideline to preserve the browser rendering to the degree possible. This is an application of the "minimize surprises" design principle. It is also a tribute to the sometimes heroic lengths browsers will go to make a document readable (and mimic each others' bugs back in the 3.x/4.x era). Browsers do not always render (even good) markup the same way or (for truly bad markup) in an intelligible way. In which case, choose the rendering you prefer among the available, intelligible choices. It sounds like this is actually where you are with things. I.e. are we dealing with markup that produces a wacky layout? Fwiw, I think Dave R.'s original idea is that folks just forget the outer <table> tag sometimes. <tr> tags too. So, if you encounter a naked <TD>, give it some clothing. I don't think he had thought through the cases you are addressing now, which are more ambitious. Charlie At 05:43 AM 11/24/2009 +0100, Ger Hobbelt wrote: >On Mon, Nov 23, 2009 at 4:58 PM, Christopher Woods <[email protected]> >wrote: > > Are you sure that the browsers are actually turning the <tr> content > before the table into a table? > >AFAICT they don't, but then browser rendering isn't exactly the >epitome of reference for deciding what to do with shoddy html IMHO. > >May sound odd, but I don't use tidy to 'keep it looking exactly the >same' in browsers; I use it as a, by now instinctive, part of my >editorial workflow to ensure the servers get fed reasonably well >formed HTML while I might have been doing sleight of hand in the >manual edit process. In which case wrapping a <table> around those ><tr>s is particularly desirable as my hands might have forgotten my >brain wanted it in there - it happens that I sometimes outthink my >typing so words get lost midway. > >In other words: tidy sits in an early position in the editorial >workflow chain with me, not as a slapped-on webserver 'afterthought' >where [generated] crud is compressed into W3C standards adherence, >while required to keep the 'intended look an feel'. mod_tidy et al are >nice, but there are some days where I think a crossbow with serrated >edge bolts is a far better solution to the problems mod_tidy and >friends is expected to solve. > >Never mind that bit of early morning temper, the current state of >affairs ditches the <tr> if it doesn't come with <td>s as well, so it >discards 'completely misplaced <tr>s' shall we say? At least it does >now for several of my test cases, which is desirable behaviour, at >least to me. [Testcases in+out to be posted later; I still suspect the >code from hiding a couple of nasties from me] > > > > > If I remember correctly, when I did some tests on this back in Feb 2006 > the browsers just basically stripped the <tr> (or maybe I only had > checked <td>) before any table away and discarded it. I put in a feature > request to add a new option to disable Tidy's "inferred table" functionality: > > > > > https://sourceforge.net/tracker/?func=detail&aid=1429519&group_id=27659&atid=390966 > > > > It's a bit dated now as the request was filed in late Feb 2006 but I > did note which versions of the code the diffs were created from. You > *might* want to check this and see if the behavior is visually more consistent. > > > > -Chris > >Hadn't checked that one, but will do, certainly. I think I'm much >closer to your original intent now than I was when I wrote that >message you responded to (and I was trying to be lazy about >implementing functionality), but there are still cases where inferred >tables have merit: when everything but the <table> is missing, I'd >like to see them happen. Otherwise, completely shot <tr> sections >would probably be best served without the <tr> at all. Trying to >accomplish that [ballet] splits now. ;-) > > >-- >Met vriendelijke groeten / Best regards, > >Ger Hobbelt > >-------------------------------------------------- >web: http://www.hobbelt.com/ > http://www.hebbut.net/ >mail: [email protected] >mobile: +31-6-11 120 978 >-------------------------------------------------- > >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Tidy-develop mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/tidy-develop ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july