HTML Tidy complied successful with some minor troubles.

Previous Topic Next Topic
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view

HTML Tidy complied successful with some minor troubles.
Recently, I am on a project of converting HTML to XHTML. In vs2010, I started writing programs to run, this is a test. In the tidy..h example, is noted. I added added library file, there areseveral projects with library files and so on.
here is the code:

Ran successfully.
Results are as follows:

Files after conversionapparently, is the header file, unlike the second inside is starting with the XML declaration. This function also has a problem. where goes wrong?

My customer owns this site:, which contains some basic bugs that violation of w3 standard even though I have tried to fix.

Reply | Threaded
Open this post in threaded view

Re: HTML Tidy complied successful with some minor troubles.

Geoff McLane

Ok, you seem to have successfully written a test app to use tidy
library... that's good...

You say 'This function also has a problem.', and assume you refer to
tidySaveBuffer(...), but it is not clear???

And then you ask 'where goes wrong?'!

Well, exactly what goes wrong? What do you expect?

You passed the library just a small snippet of html, so of course Tidy
library expanded it to a full xhtml document...

What else should it do? Maybe you need to be using other parts of the
API if you want something different...

Some points about your program...

I have a little repo, 'Tidy Test' - - that also links to the tidy library.

It contains a FindTidy.cmake, that will correctly find the installed
library tidy, if you convert your project to use cmake for the
configuration, and generation of the MSVC solution files...

This would mean you would not have to use the non portable MSVC #pragma
comment(lib, "tidy.lib")... In other words making your project more

And as you may know using "tidy.lib" means you are linking with the
shared (DLL) library, which then must be in the PATH, or in the same
folder to run...

For such a standalone app perhaps it is better to use the 'static'
library, "tidys.lib"...

Anyway, maybe you will get some more information on the tidy library API
from the 'Test Tidy' repo...

Maybe if you explained more exactly what you are trying to do, I may be
able to help more...


PS: Also have an ongoing WIP 'Tidy GUI 2' repo - - which needs Qt installed to
build, but it may also reveal some more things about using the tidy
library API...

Reply | Threaded
Open this post in threaded view

Re: HTML Tidy complied successful with some minor troubles.

tOM Trottier
For a real random test, you could try the top 1,000,000 sites' home pages or google
random dictionary words. That should find most bugs that send the program to cloud
cuckoo land.

tOM Trottier BBO:"0 carbon"
613-860-6633 [hidden email] Skype:Abacurial
MD5 Fingerprint
Version: 3.12
GCS$/B$/IT$/O d++(--)@>+ s:+>: a++(--)>+++
C++>++++ ULH---> P+>+++
L+>++ !E W+++ N+ w++ O M !V P+ PE- Y+ PGP t 5- X R*
tv+ b++ DI+++ D G
e+++>++++ h----> r+++>++ y++++>++