The htmLawed module uses the htmLawed PHP library to restrict and purify HTML for compliance with site administrator policy and standards and for security. Use of the htmLawed library allows for highly customizable control of HTML markup. See the guide for more on the module.
Its speed and configurability as well as full HTML coverage sets htmLawed apart from the in-built Drupal HTML filter and many other filters that require external applications like HTML Tidy or use incomplete, or large and resource-intensive libraries like HTMLPurifier.
htmLawed can be used to make text with HTML more secure, and HTML standards- and admin. policy-compliant. It can auto-correct and beautify HTML markup and restrict elements, attributes, and URL protocols in the input. It also balances tags and checks for proper nesting of HTML elements, transforms deprecated tags and attributes, checks and converts character entities, obfuscates email addresses as an anti-spam measure, etc. htmLawed is a GPL 3/LGPL 2+ licensed, single-file script with a peak memory usage of just ~1 Mb, and is well-documented. You can test htmLawed on this demo site.
The htmLawed library distributed with the module may not be up-to-date. Admins can look for a newer version of htmLawed on its website.
Project information
- Module categories: Content Editing Experience, Content Display, Security
- 1,577 sites report using this module
- Created by alpha2zee on , updated
- Drupal 10 is here!
Compatible
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
htmLawed library updated to v1.2.15
Development version: 4.1.x-dev updated 17 Mar 2024 at 22:50 UTC
htmLawed library updated to v1.2.15