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

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

TXT 转 HTML 页面——离线、原样转义、不上传TXT to HTML page offline, escaped as written, no upload

手里是一份日志、一段代码输出或一个转义过的文本,想让它「在浏览器里像它自己」——要的是网页外壳,不是重新排版。这条路只做三件事:把 `&`、`<`、`>` 转成实体,把每个换行写成 `<br>`,然后把整段放进一个 `<pre>`;文档标题取你自己的文件名。所以它与 Markdown 那条路的关键区别是**不解释任何记号**:`# 井号` 就是井号,`* 星号` 就是星号,贴 HTML 片段也只会以字符显示,不会被执行。产物是自包含的单份 HTML,双击就能打开,也可以继续被本扩展转成 Word、PDF 或图片。Sometimes what you have is a log, a code dump or an escaped blob of text, and you want it to behave like itself in a browser — a page wrapper, not a re-layout. This route does three things and no more: `&`, `<` and `>` become entities, every newline becomes `<br>`, and the whole block is placed inside a single `<pre>`, with your own file name as the page title. The difference from the Markdown route is that **no notation is interpreted**: `# hash` stays a hash, `* star` stays a star, and pasted HTML shows up as characters instead of running. The artefact is one self-contained page you can double-click, and it can go on through this extension to Word, PDF or an image.

一批转换结果卡片,含文件名、体积与下载入口
一次混合批量,一个 ZIP 下载One mixed batch, one ZIP download

这条链路怎么走How the route runs

纯文本 (TXT)plain text (TXT) HTMLHTML

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

会保留什么What carries over

  • 换行与连续空格:`<pre>` 原样保留缩进、对齐与制表符,日志和代码块的形状不变Line breaks and runs of spaces: `<pre>` keeps indentation, alignment and tabs, so a log or code dump holds its shape
  • 字符按字面呈现:`&`、`<`、`>` 转成实体,贴进去的标签只会显示为文字,不会成为活的标记Characters appear literally: `&`, `<` and `>` become entities, so markup pasted in stays visible text and never becomes live markup
  • 文档标题取你自己的文件名,浏览器标签页与收藏里认得出来The document title comes from your own file name, so the browser tab and a bookmark still identify it
  • 编码不是前提:先按 BOM 与 NUL 分布嗅探 UTF-16,再依次尝试 UTF-8 → GB18030 → GBK;四种都读不出文本时直接报错,不产出一份乱码页面The encoding is not a precondition: UTF-16 is sniffed from the BOM and the NUL pattern first, then UTF-8 → GB18030 → GBK, and a file none of them can read fails instead of shipping a mojibake page

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

  • 不识别 Markdown:`#`、`-`、`|`、围栏反引号都只是字符,想要标题与表格请用 TXT 转 Markdown 或直接写 .mdNo Markdown is read: `#`, `-`, `|` and backtick fences stay characters — use TXT to Markdown, or write .md, when you want headings and tables
  • 整篇是一个 `<pre>` 块:没有标题层级、没有列表结构,屏幕阅读器读到的就是一大段等宽预格式化文字The file is one `<pre>` block: no heading levels and no list structure, so a screen reader meets a single run of monospaced preformatted text
  • 超长的行不会被折:`<pre>` 保持原样,窄窗口里可能出现横向滚动条(要自动折行请自行改 CSS 或走 Word 路线)Long lines are not wrapped: `<pre>` keeps them, so a narrow window can show a horizontal scrollbar (adjust the CSS yourself, or take the Word route)
  • 产物只带默认版式(字体与留白来自文档自身的样式表),不带目录、高亮、行号这些编辑器功能The page carries default typography only — fonts and padding from the document’s own stylesheet, with no table of contents, syntax highlighting or line numbers
  • 一批最多 200 个文件、单个上限 100 MB;多份一起转逐个产出各自的 .html,想一次拿走就打成一个 ZIPUp to 200 files per batch and 100 MB each; several files yield one .html apiece and can be taken as a single ZIP

实操提示Working with it

  • 想要带配色与折叠的结构化视图:那是 JSON 转 HTML 或 CSV 转 HTML 在做的事,这条只保证「像它自己」For a structured view with colour and folding: that is JSON to HTML or CSV to HTML — this route only promises “behaves like itself”
  • 想给纯文本加上结构与样式再交付:TXT → Markdown → Word(或 → HTML 后自行编辑),比直接包一层 `<pre>` 更可排印To give plain text structure and styling before delivery: TXT to Markdown to Word (or to HTML and edit) typesets better than one `<pre>` wrapper
  • 只想打印或存档:TXT → PDF 会把整页渲染成图片,产物没有文字层,选中不了文字To print or archive it: TXT to PDF renders whole pages to images, so that artefact has no text layer and its words cannot be selected

常见问题Questions people actually ask

我在文本里贴了一段 HTML,会被执行吗?I pasted HTML into the text — will it execute?

不会。`<` 与 `&` 在写出前就被转成实体,脚本与标签在产物里只是可见字符;这也是这条路径的核心保证。No. `<` and `&` are turned into entities before the file is written, so scripts and tags remain visible characters in the artefact — that is the point of this route.

为什么 `# 第一章` 没变成标题?Why didn’t “# Chapter 1” become a heading?

因为这条路径读的是纯文本,不解释任何记号——`#` 就是字符。要标题层级,走 TXT 转 Markdown(它会整段包成代码块,所以更稳的做法是自己写 .md)或直接准备 .md 文件。Because this route reads plain text and interprets no notation — `#` is a character. For headings, go TXT to Markdown (which wraps the file as a code block, so authoring .md directly is steadier) or start from a .md file.

日志里的中文和旧编码文件能正常显示吗?Will Chinese text and old-encoding logs display correctly?

按 UTF-8 → GB18030 → GBK 依次尝试(并先嗅探 UTF-16),老编辑器导出的 GBK 日志也能读进来;实在读不出就直接报错,不给一份乱码页面。UTF-8 → GB18030 → GBK are tried in turn, with UTF-16 sniffed first, so a GBK log from an older editor still reads; if nothing matches it fails rather than producing a page of mojibake.

这份日志会被上传吗?Is this log uploaded anywhere?

不会。读取、转义、包页全在扩展自己的标签页里完成,只申请 storage 权限、没有 host 权限,全程零网络请求。No. Reading, escaping and wrapping all happen inside the extension’s own tab: the storage permission only, no host permissions, and no requests at any point.

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