# dsh-tool-markdown [中文](README.md) DSH Markdown tool plugin — HTML↔Markdown conversion, GFM table normalization, table-of-contents generation. Zero dependencies, pure functions, hand-written lightweight parser. [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) ## Motivation The most common document scenarios for models: the user pastes a block of HTML (web page source, email, exported file), pastes a table asking for cleanup, or asks to "convert to markdown". Without a tool, the model can only hard-code the handling — HTML entities go wrong, tables get mangled, and web noise (nav/scripts/ads) leaks in. This plugin provides deterministic conversion and complements `dsh-tool-csv`: **csv handles structured tables, markdown handles documents/web pages**. ## Security model - **Zero dependencies**: hand-written recursive-descent HTML parser (no cheerio/jsdom — they add tens of MB and are an attack surface) - **Zero execution surface**: no eval, no new Function, no remote resource loading, no CSS layout parsing - **Content stripping**: script/style/iframe/object/noscript contents are stripped entirely (security + noise) - **md2html whitelist**: only outputs `p h1-h6 ul ol li blockquote pre code a img strong em br hr table thead tbody tr th td`; all text is HTML-escaped — a `