Loofah
Ruby library for HTML/XML transformation and sanitization observed · 2026-10-22
Health v2 · maintenance only
87/100
- Activity 100
- Release rhythm 62
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-22. Adoption (stars, forks) is never an input.
- gap_med: 105.5
- age_days: 6283
- days_rel: 98
- days_push: 0
- n_releases_24m: 7
Adoption not part of the score
1000 stars · 146 forks observed · 2026-10-22
What it is AI-extracted, prompt v1, taxonomy v1, 2026-09-07, confidence 0.95
Loofah is a Ruby library built on Nokogiri for manipulating and transforming HTML/XML documents and fragments, including a framework for writing custom scrubbers. It ships built-in HTML sanitizers based on html5lib's safelist, with optional Active Record extensions via the loofah-activerecord gem.
Use cases
- sanitize user-submitted HTML to prevent XSS
- strip or escape unsafe HTML tags in Ruby apps
- transform HTML documents with custom scrubbers
- convert HTML markup to plain text
- add nofollow or target=_blank attributes to links
- replace Rails strip_tags and sanitize helpers
- sanitizing ActiveRecord model attributes
When to choose
- you need HTML/XML sanitization in a Ruby application
- you want a general framework for writing custom document transformations
- you use Rails and want stronger sanitization than the defaults
- you need plain-text formatting from HTML with sensible whitespace handling
When to avoid
- you need highly flexible tag/attribute allowlist configuration (consider rgrove/sanitize)
- you are not working in Ruby
- you only need to parse documents without transformation (plain Nokogiri may suffice)
Facets
library · maturity stable
serialization security parser nlp web-development security developer-tools parsers ruby html-sanitization html-parsing xml nokogiri scrubbers xss-protection activerecord
1 source
- readme: https://github.com/flavorjones/loofah · fetched 2026-10-22 · e4520e59183f
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| flavorjones/loofah | main | 87 |
| flavorjones/loofah-activerecord | plugin | 32 |
For agents
markdown · JSON · MCP: product_card(name="flavorjones/loofah")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem