htmLawed is a single-file PHP software that makes input text secure and more standard-compliant, and suitable in general from the viewpoint of a web-page administrator, for use in the body of HTML 4, or XHTML 1 or 1.1 documents. It thus is a customizable HTML/XHTML filter, processor, purifier, sanitizer, etc., like the 'Kses', 'HTMLPurifier', etc., PHP scripts.
The 'lawing in' of input text is needed to ensure that HTML code in the text is standard-compliant, does not introduce security vulnerabilities (like XSS), and does not break a web-page's design/layout. htmLawed does this by, for example, making HTML well-formed with balanced and properly nested tags, neutralizing code that may be used for cross-site scripting ('XSS') attacks, and allowing only specified HTML elements/tags and attributes.