Perl Monk, Perl Meditation | |
PerlMonks |
Fixing Bad HTMLby Cody Pendant (Prior) |
on Nov 16, 2002 at 23:17 UTC ( [id://213469]=perlquestion: print w/replies, xml ) | Need Help?? |
Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
I do some work on a board where some HTML is allowed, for instance bold and italic and font colours.
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.
Back to
Seekers of Perl Wisdom
|
|