W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2008

Output HTML snippets?

From: CJ Kucera <pez@apocalyptech.com>
Date: Thu, 15 May 2008 10:12:16 -0500
To: html-tidy@w3.org
Message-ID: <20080515151216.GD14078@apocalyptech.com>

Hello - I'd like to use HTML Tidy to sanitize some snippets of HTML, but
ideally I'd like it to only fix problems with the given text, without
outputting a whole HTML document, if possible.

So, if it were fed the following:

   <i>Here's an unclosed tag

It'd just ouput this:

   <i>Here's an unclosed tag</i>

.... instead of outputting a whole HTML document.  I've dug through the
available options a few times but haven't seen anything; I'm wondering
if that's just Not Possible.  If anyone's got ideas, I'd appreciate 'em.

As a bit of background, this is for a little web-based RSS aggregator -
often feeds will have some seriously malformed HTML which needs to be
fixed, but it shouldn't really have full <html> tags, etc.

Thanks!

-CJ

-- 
WOW: Flemmy            |   "Happiness isn't good enough for me!  I
pez@apocalyptech.com   |              demand euphoria!"
24.24.2.3171           |                  - Calvin
Received on Friday, 16 May 2008 10:00:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:59 GMT