Loofah is a Ruby library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In production it functions primarily as the HTML sanitization engine behind Rails (via rails-html-sanitizer) and countless other Ruby web applications: it parses untrusted user-supplied HTML and scrubs out unsafe tags, attributes, URLs, CSS properties, and protocols while preserving safe markup. The library combines a general-purpose transformation framework (custom 'scrubbers') with a specific html5lib-derived sanitizer safelist covering HTML, MathML, and SVG elements, ARIA attributes, CSS properties/functions, and URI protocols. The codebase deliberately supports both HTML4 (libxml2) and HTML5 (gumbo) parsing paths, and is the de facto standard for server-side HTML sanitization in the Ruby ecosystem.
Jodit is a pure TypeScript WYSIWYG HTML editor designed for embedding in web applications. It provides a rich editing experience with a toolbar, file browser, image editor, and support for complex formatting, tables, media embedding, and source code editing. The editor is built on a modular plugin architecture with over 60 built-in plugins, a custom event system, a UI component framework, and extensive internationalization (30+ languages). It includes security-focused HTML sanitization, undo/redo with snapshot history, and async storage providers (IndexedDB, localStorage, memory). The project is MIT-licensed with a commercial PRO version offering additional plugins like AI assistant and PDF export. The architecture is layered: core modules (event emitter, DOM helpers, selection/style engine, async utilities, decorators) provide the foundation; a plugin system manages lifecycle and dependencies; UI components (buttons, forms, popups, dialogs) are built with a BEM-like naming scheme and state-driven rendering; and modules (file browser, uploader, toolbar, history) implement higher-level features. The editor can operate in inline or iframe mode, supports dark themes, and is responsive with mobile-adaptive toolbars. Key entry points are the Jodit class constructor and the static Jodit.make() factory method. The primary data flow is user input (keyboard, mouse, clipboard) processed through the selection engine and plugins, producing sanitized HTML output. External runtime dependencies are minimal (no required JavaScript libraries), but the build system relies on Webpack, TypeScript, and various development tools.