DENG a écrit : > hi all, > > i use SGMLParser to process HTML files, in order to do some > optimizations, > > something like this: > > <i><b>TEXT1</b></i><b><i><u>TEXT2</u></i></b> > > optimise to > > <i><b>TEXT1<u>TEXT2</u></b><i>
Doesn't Tidy do this already ? > > at the very beginning, i was thinking of analysing each text-block, to > know their color, size, if is bold or italic, but i found it was too > complicated. > > e.g > > <font color=red><font size=6>TEXT1</font></font> Whoever writes such a thing in 2005 ought to be shot down for the sake of mankind !-) > optimise to > > <font color=red size=6>TEXT1</font> You call this "optimized HTML" ? Even MS Word produces better code... > > but if there is TEXT2 exist > > <font color=red><font size=6>TEXT1</font>TEXT2</font> > > we can not do any optimization. > > my problem is I can not find a method to treat all those situation, Tidy is open source AFAICT. > I > had too much thinking and get fool now > > > anyone can give me some advices? Learn to use Tidy and CSS. -- http://mail.python.org/mailman/listinfo/python-list