Hi, > I'd like to use HTML Tidy in some applications, but they mostly deal > with strings instead of files. Has anyone rewritten the current code > to deal with (char*) strings or is anyone going to do so? I've been doing this using a two way pipe. Because of how tidy works, reading all input before doing any output, the usual buffering problems related to open2 don't cause trouble here. An example in Perl: use IPC::Open2; open2(*R, *W, 'tidy 2>/dev/null'); print W '<h1>Hello</h1>'; close W; local $/ = undef; $html = <R>; close R; print $html; The output looks like: $ ./open2.pl <html> <head> <title></title> </head> <body> <h1>Hello</h1> </body> </html> HTHReceived on Tuesday, 10 April 2001 12:32:14 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:45 GMT