Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: HTML beautifier



On Thu, Jul 23, 1998 at 02:49:22PM +0900, Jonathan Byrne - 3Web wrote:
> I'm trying to find a shortcut to take the way some people's HTML looks
> and transmogrify it to how I want it to look.  Specifically, they use
> lowercase in all their tags, and oddly, sometimes make the attributes
> uppercase.  Accordingly, this shortcut needs to:

I'm not aware of a tool like this, but would like to suggest a more rigorous
methodology, rather than rely on the sort of heuristics you've described.  If
you fed your HTML through something that could actually parse valid HTML, you
could recreate the output in your own image.  (My favorite tool for this at
the moment is htmllib.py/formatter.py of the standard Python distribution.
It is handy at converting from HTML to other formats... no reason why the
"other" format couldn't be HTML again. :-)

> 2) Convert all alphabetic characters between a set of quotation marks to
> lowercase.  Again, it should not be spooked by double-byte characters,
> and it should ignore all non-alphabetic characters in the string to be
> converted.

Careful...  you don't want to change the case of things of HREF attributes.

-- 
Jim Tittsler, Tokyo   ICQ: 5981586

--------------------------------------------------------------
Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30
featuring Linux on multiple platforms:
i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ...
Next Nomikai: September, 19:30 Tengu TokyoEkiMae 03-3275-3691
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links