Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

htmLawed

1,334 sites Security covered
View on drupal.org

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.

Activity

Total releases
2
First release
May 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
7.x-3.16 Stable May 2, 2025
4.1.6 Stable May 2, 2025