文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

HTML 转 Markdown——表格、任务清单与图示都保住HTML to Markdown offline — tables and tasks kept

把一篇网页、导出的笔记或富文本片段收进 Markdown 仓库,最怕的是表格被整块吞掉、复选框连行一起消失。这条路径用 Turndown 生成 ATX 标题与围栏代码块,并为表格补了一条 GFM 规则:整张表一次性序列化,单元格文本压平、竖线转义、短行补齐;任务列表的复选框在 `<li>` 里时写成 `[x] ` / `[ ] `。内联 SVG 在转换前先栅格化成 `data:image/png`,否则 Turndown 没有对应规则,整张图只剩几个孤立的文字节点。Moving a page, an exported note or a rich-text fragment into a Markdown repository usually goes wrong in two places: the table disappears wholesale and the checkbox takes its line with it. This route uses Turndown for ATX headings and fenced code, and adds a GFM rule for tables: the whole table is serialized at once, cell text is flattened, pipes are escaped and short rows are padded. A checkbox inside an `<li>` becomes `[x] ` / `[ ] `. Inline SVG is rasterized to `data:image/png` before conversion — Turndown has no rule for it, and without that step a diagram collapses to a handful of disconnected text nodes.

左右对照的预览与编辑视图
左右对照预览,下载前直接改Preview side by side, edit before you download

这条链路怎么走How the route runs

HTMLHTML MarkdownMarkdown

共 1 步,由扩展的路径搜索自动选出,中间产物不落盘。1 step, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 标题、列表、强调、删除线、引用块、围栏代码块与行内代码,按 GFM 语法输出Headings, lists, emphasis, strikethrough, quotes, fenced code blocks and inline code come out as GFM
  • 表格按 GFM 管道表输出;单元格内的竖线会转义,长短不齐的行按表头列数补齐Tables become GFM pipe tables; pipes inside cells are escaped and ragged rows are padded to the header’s column count
  • `<li>` 里的任务复选框写成 `[x] ` / `[ ] `,列表层级由 Turndown 的列表规则保留A checkbox inside an `<li>` becomes `[x] ` / `[ ] `, with list nesting left to Turndown’s list rules
  • 图片保留为 `![alt](src)`;内联 SVG 先栅格化成 PNG data URI 再写成图片链接Images stay as `![alt](src)`; inline SVG is rasterized to a PNG data URI and written as an image link
  • 一批最多 200 个文件、单个 100 MBUp to 200 files per batch at 100 MB each

如实说明的限制What it does not do

  • 单元格内的行内格式被压平成纯文本:一张表里的加粗、链接与代码样式不会带进 Markdown(这是保住整张表的代价)Inline formatting inside a cell is flattened to text: bold, links and code styling within a table do not reach the Markdown — the price of keeping the table intact
  • 嵌套表格只按外层处理,内层内容以文本并入外层单元格;HTML 的 `<div>`、class、内联样式与 CSS 全部丢弃Nested tables are handled through the outer table only, with inner content merged into the outer cell as text; `<div>`, classes, inline styles and CSS are all dropped
  • 远程图片不会被下载,但会原样写成 `![](https://…)`:扩展自身不发起请求,打开这份 Markdown 的编辑器或预览器可能去取图Remote images are not downloaded, but they are written out as `![](https://…)`: the extension makes no request, while the editor or previewer you open the Markdown with may fetch them
  • 不是可逆转换:HTML → Markdown → HTML 回不到原页面,结构、样式与脚本都不会复原It is not reversible: HTML → Markdown → HTML does not return the original page; structure, styling and scripts do not come back
  • 内联 SVG 栅格化后是位图,矢量可编辑性丢失A rasterized inline SVG is a bitmap, so vector editability is lost

实操提示Working with it

  • 适合把文档站、邮件与富文本导出收进仓库;需要保留完整版式时改走 HTML → PDF(整页渲染,但没有文字层)Good for pulling docs sites, emails and rich-text exports into a repository; when the full layout matters, take HTML → PDF instead (whole-page rendering, but no text layer)
  • 同一份 HTML 还能转 Word 或纯文本;那两条分别保留 Word 结构与阅读顺序,与这条的取舍不同The same HTML can go to Word or plain text; those routes keep Word structure and reading order respectively, with different trade-offs

常见问题Questions people actually ask

表格里的加粗为什么没了?Why did the bold text inside my table disappear?

因为整张表由一条规则一次性序列化,单元格取的是 textContent 再压平空白。这样做换来的是表格结构一定不丢;若逐格保留行内标记,嵌套表格与短行就会把输出撑破。Because the whole table is serialized by one rule, and each cell is reduced to its textContent with whitespace flattened. That is what guarantees the table structure survives; preserving inline markup cell by cell would break the output on nested tables and ragged rows.

内联 SVG 会怎样?What happens to inline SVG?

先离屏渲染成 PNG,再写成 `![alt](data:image/png;base64,…)`。没有这一步时 Turndown 会把整个 `<svg>` 子树压成几个文字节点,图就没了。位图意味着不能再在 Markdown 里编辑矢量。It is rendered offscreen to PNG first, then written as `![alt](data:image/png;base64,…)`. Without that step Turndown flattens the whole `<svg>` subtree into a few text nodes and the diagram is gone. Being a bitmap, it can no longer be edited as a vector inside the Markdown.

转换时会不会去抓网页里的图片?Does the conversion fetch the page’s images?

不会。扩展没有 host 权限,转换器只把 `<img src>` 写进 Markdown。之后你用某个编辑器打开这份 .md,若它选择去取远程图片,那是那个软件的请求,不是这一次转换发出的。No. The extension has no host permissions, and the converter only writes `<img src>` into the Markdown. If the editor you later open the .md with chooses to fetch a remote image, that request belongs to that software, not to this conversion.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.