filter-js-from-html

Remove JavaScript from HTML documents while preserving structure and formatting.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/Zurybr/lefarma-skills --skill filter-js-from-html
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filter-js-from-html
Source: https://github.com/Zurybr/lefarma-skills/tree/main/letta/benchmarks/trajectory-only/filter-js-from-html
Command: npx skills add https://github.com/Zurybr/lefarma-skills --skill filter-js-from-html

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance for safely removing JavaScript from HTML documents, preventing cross-site scripting (XSS) vulnerabilities while preserving the original structure and formatting.

Core Features & Use Cases

  • XSS Prevention: Identify and neutralize various JavaScript injection vectors within HTML.
  • Format Preservation: Ensure that the HTML structure, whitespace, and entities remain unchanged after filtering.
  • Use Case: When accepting user-generated HTML content for a forum or comment section, use this Skill's guidance to clean the input and prevent malicious scripts from executing.

Quick Start

Follow the recommended approach in the SKILL.md file to implement JavaScript filtering for HTML content.

Frequently Asked Questions about filter-js-from-html

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove JavaScript from HTML to prevent XSS attacks?

Removing JavaScript from HTML involves parsing the document to identify and neutralize dangerous patterns in elements and attributes. This process prevents cross-site scripting vulnerabilities while preserving the original HTML structure and formatting.

What is the best way to sanitize user-generated HTML content for a comment section?

Sanitizing user-generated HTML content requires comprehensive filtering to identify various JavaScript injection vectors. This approach ensures malicious scripts are neutralized before execution, while maintaining the original HTML structure, whitespace, and entities.

How does HTML sanitization handle format preservation when filtering out scripts?

HTML sanitization carefully parses the document to remove dangerous JavaScript patterns without altering the overall structure. It ensures that whitespace, HTML entities, and formatting remain completely unchanged after the filtering process.

Can I use HTML filtering techniques to clean multiple XSS attack vectors?

Yes, comprehensive HTML filtering addresses multiple XSS attack vectors by requiring careful parsing and robust verification. It identifies dangerous patterns within both elements and attributes to effectively neutralize potential script injections.

What are the limitations of removing JavaScript from HTML documents?

Limitations include the need for careful parsing and robust verification to catch all dangerous patterns in elements and attributes. Incomplete filtering can leave XSS vulnerabilities, requiring strict adherence to comprehensive identification strategies.