Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
Every so often someone posts some HTML which is missing the end tag, and then, you know the whole rest of the page is pink or something.
So I and another coder want to make some kind of script to count opening and closing tags and add the missing ones where necessary.
It's more or less a theoretical question here, because the board is written in PHP, but, what structure would monks use to try and figure out that the post had one or more opening tags which were unclosed, and to try to close them in the correct order?
Hashes. arrays, AoH, HoA? -- I'm not seeing any neat data structure in my head.
--
($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fixing Bad HTML
by Chmrr (Vicar) on Nov 17, 2002 at 03:07 UTC | |
Re: Fixing Bad HTML
by chromatic (Archbishop) on Nov 16, 2002 at 23:49 UTC | |
Re: Fixing Bad HTML
by pg (Canon) on Nov 17, 2002 at 00:02 UTC | |
by Cody Pendant (Prior) on Nov 17, 2002 at 01:25 UTC | |
by diotalevi (Canon) on Nov 17, 2002 at 02:25 UTC | |
by sauoq (Abbot) on Nov 17, 2002 at 01:59 UTC | |
by seattlejohn (Deacon) on Nov 17, 2002 at 23:05 UTC |