Lua HTML Tidy Bindings

Here you'll find the lua bindings for HTML Tidy.

Source code compiles on Linux and Windows

Download

Lua HTML Tidy 1.0.2 (October 29, 2006) (source + Ubuntu Lua 5.0 so.)

Example

require('htmltidy')

f = (io.open('test.html', 'r'))
r = f:read("*all")
f:close()

local c = htmltidy.new()
c:parse(r)
local x = c:toTable()
-- this one prints the whole table. It's a great function
-- don't miss out.
if table.print then
	 table.print(x)
end

c:setOpt(htmltidy.opt.XhtmlOut, true)
local cleaned = c:saveToString()

print(cleaned)

Copyright

This software is MIT Licensed just like Lua 5.0