Some comments on HTML tidy

"Reece Dunn" <[email protected]> Sat, 31 Dec 2005 19:33:03 +0000
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Hi all,

I am using HTML tidy as a HTML parser that feeds into a text outputter to do 
HTML ==> text conversion. This is a great tool, but here are a few things I 
have noticed and have modified:

[1]  in the C++ binding (tidyx.h), IsHeader() is missing a return statement:
-    Bool IsHeader()      { tidyNodeIsHeader( tnod() ); } /* h1, h2, ... */
+    Bool IsHeader()      { return tidyNodeIsHeader( tnod() ); } /* h1, h2, 
... */

[2]  the C++ binding functions should be const qualified, e.g.

    Bool IsHTML() const       { return tidyNodeIsHTML( tnod() ); }

[3]  the tidy API tidyNodeCMIs... are not yet exposed. Is there a reason for 
this? I have exposed them and added support in tidyx.h as I am using 
Tidy::Node::IsBlock() in my HTML ==> text application.

[4]  normally, any extended character (e.g. &emdash;) is outputted in its 
escaped form when you specify an output encoding. For my application, I want 
to prevent the escaping of these characters. As such, I have added a 
TidyNoCharEscaping option to disable character escaping.

[5] HTML tidy doesn't appear to have any auto detection of the character 
encoding being used (except for the UTF BOM). That is, any <meta> tag that 
specifies the text encoding. Is there an easy way that I can do this?

[6] I am having problems getting the <win32tc.h> logic 
(TIDY_WIN32_MLANG_SUPPORT) working. It is producing an access violation that 
I have not (yet) been able to track down - it appears to be happening 
somewhere in ole32.dll.

If people are interested in these modifications, I am willing to post the 
patch files for them.

Happy New Year,
- Reece H. Dunn




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click