---
name: "html2text-markdown-stripper"
description: "Convert messy HTML documents into clean, structured Markdown for LLM ingestion."
metadata:
  author: "Alir3z4"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "convert html to markdown python"
  - "strip html tags to markdown"
  - "clean web page text html2text"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# html2text Clean Markdown Conversion Pipeline

Converts web articles and HTML emails into readable Markdown using html2text in Python: stripping unwanted styling, formatting tables as ASCII grids, and preserving semantic links and headings.

## When to Invoke
Invoke this skill whenever you need to:
- convert html to markdown python
- strip html tags to markdown
- clean web page text html2text

## Execution SOP & Rules
1. Configure converter with h = html2text.HTML2Text() and set h.ignore_links = False.
2. Enable table formatting support with h.body_width = 0 to prevent artificial line wrapping.
3. Convert content with markdown_text = h.handle(html_string).
4. Strip consecutive blank lines and trailing whitespace from the resulting Markdown.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
