Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

htmLawed

Security covered Under active development 1,450 sites

This module uses the htmLawed PHP library to securely restrict and purify HTML content. It provides highly customizable control over HTML markup, offering an efficient and feature-rich alternative to other filtering solutions. The module can enforce security policies, automatically correct and beautify HTML, and prevent issues like spam.

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.

Drupal 8–11

Ask your assistant about htmLawed

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
10
Tracked since
May 2023
Latest release
3 days ago
Releases (12 mo)
5 ▲ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
8.x-3.9 Stable Oct 12, 2026
4.1.8 Stable 8–11 Oct 6, 2026
7.x-3.17 Stable Aug 8, 2026
8.x-3.8 Stable 8 Aug 7, 2026
4.1.7 Stable 8–11 Aug 5, 2026
7.x-3.16 Stable May 2, 2025
4.1.6 Stable 8–11 May 2, 2025
4.1.5 Stable 8–11 Jul 2, 2024
4.1.4 Stable 8–11 Mar 17, 2024
4.1.3 Stable 8–10 May 3, 2023