cl-tidy [ASDF system]

FFI bindings for HTML Tidy

License:BSD sans ad-clause
Author:Red Daly <reddaly at>
Dependencies:cl-tidy, cffi


HTML Tidy for Common Lisp


CL-Tidy is a small set of bindings for the HTML Tidy library. It is used for cleaning up mostly-correct HTML pages and for identifying the problems in an understandable way. From the author of Tidy:

Tidy is able to fix up a wide range of problems and to bring to your attention things that you need to work on yourself. Each item found is listed with the line number and column so that you can see where the problem lies in your markup. Tidy won't generate a cleaned up version when there are problems that it can't be sure of how to handle. These are logged as "errors" rather than "warnings".

The interface is described in detail below but the basic usage is this:

(cl-tidy:clean-up-html (drakma:http-request "")) 


  1. Download and Installation
  2. Functions
    1. clean-up-html

Download and Installation

All the code is maintained in a git repository. To obtain the library, use the following command:

git clone git:// 

You can also browse the code at


clean-up-html string

Given an HTML string, string, runs the input through Tidy. If Tidy can handle the input, returns a version of the document that is valid XHTML.

Thus, most dirty web pages from the internet can be grabbed run through CLEAN-UP-HTML and subsequently passed into a strict XML parser.