# filter-js-from-html > Guidance for removing JavaScript from HTML while preserving structure and formatting. This skill applies when filtering XSS vectors, sanitizing HTML content, removing script tags and event handlers, or building HTML sanitization tools. It covers comprehensive XSS vector identification, format-preserving transformations, and verification strategies. - Author: Cameron - Repository: letta-ai/skills - Version: 20260120211011 - Stars: 49 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/letta-ai/skills - Web: https://mule.run/skillshub/@@letta-ai/skills~filter-js-from-html:20260120211011 --- --- name: filter-js-from-html description: Guidance for removing JavaScript from HTML while preserving structure and formatting. This skill applies when filtering XSS vectors, sanitizing HTML content, removing script tags and event handlers, or building HTML sanitization tools. It covers comprehensive XSS vector identification, format-preserving transformations, and verification strategies. --- # Filter JavaScript from HTML This skill provides guidance for tasks involving the removal of JavaScript from HTML documents while preserving the original structure and formatting. These tasks require careful handling of multiple XSS attack vectors and strict format preservation. ## Task Recognition This skill applies to tasks that involve: - Removing JavaScript from HTML files - Building HTML sanitizers or filters - Stripping script tags and event handlers - Sanitizing user-generated HTML content - XSS prevention through HTML transformation ## Core Challenges ### 1. Multiple JavaScript Injection Vectors JavaScript can be embedded in HTML through numerous mechanisms: | Vector Type | Examples | |-------------|----------| | Script elements | `