Re: Problem tidying.

Just wondering? Is this what tidy does?

================
From: Richard A. O'Keefe <ok@cs.otago.ac.nz>
Date: Thu, 12 Jun 2003 13:07:05 +1200 (NZST)
Message-Id: <200306120107.h5C175j6358672@atlas.otago.ac.nz>
To: html-tidy@w3.org


Concerning
    <table><form><tr>...</form></table>
there's a heuristic which sometimes help:
1.  if there is a start-tag <X> inside an element <E>...
    and X is not allowed inside E
    but E is allowed inside X
    and X is allowed inside E's parent
    then move <X> to just before <E>...

2.  if there is an end-tag </X> inside an element <E>...
    and X is not allowed inside E    -- these two conditions
    but E is allowed inside X        -- imply that X is not E
    and X is (now) E's parent
    then replace </X> by </E></X><E>
    and flag the new <E> as generated by Tidy.

3.  if you find <E></E> where <E> was generated by Tidy,
    quietly remove both <E> and </E>.

In the table/form case, we get              *
    <form><table><tr>...</table></form><table></table>
and rule 3 then quietly erases <table></table>

Received on Thursday, 20 November 2003 19:23:39 UTC