Subject: | [PATCH] Add a 'repair' option to fix unclosed HTML tags |
Date: | Wed, 5 Jul 2006 18:54:27 -0400 |
To: | bug-html-truncate [...] rt.cpan.org |
From: | kevinr [...] bestpractical.com (Kevin Riggle) |
I've patched HTML::Truncate to add a 'repair' option (with
getter/setter, perldoc, and tests), which closes unclosed HTML tags.
HTML::Truncate actually already performed this behavior somewhat, but it
would only repair tags at the end of the input (eg. '<b>foobar' became
'<b>foobar</b>'). This patch allows HTML::Truncate to repair tags in
the middle of its input. It takes unmatched open tags and closes them
as late as possible (so '<b><i>foobar</b> baz' becomes
'<b><i>foobar</i></b> baz'), and it drops unmatched close tags (so
'foo</i>bar' becomes 'foobar').
- Kevin
--
Kevin Riggle <kevinr@bestpractical.com>
Best Practical Solutions, LLC
Message body is not shown because sender requested not to inline it.