Html 编辑 .mht(网络存档)文件的最佳方式是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16237813/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 07:54:19  来源:igfitidea点击:

What is the best way of editing .mht(web archive) files?

htmlmhtml

提问by slisnychyi

If you faced with situation when you need to edit .mht file (for example: add some text to site).

如果您遇到需要编辑 .mht 文件的情况(例如:向站点添加一些文本)。

Could you please suggest the best way of editing .mht(web archive) files?

您能否建议编辑 .mht(网络存档)文件的最佳方法?

What I've tried:

我试过的:

  1. (editors like: notepad, word);

  2. I-Explorer add-ons (like HTML Quick edit Bar)

  1. (编辑器如:记事本、word);

  2. I-Explorer 附加组件(如 HTML 快速编辑栏)

采纳答案by zakinster

An MHTMLfile is a web page archive format. It is meant to be stored and viewed but not to be edited directly.

一个MHTML文件是一个网页存档格式。它旨在存储和查看,但不能直接编辑。

However, you can easily extract the MHTML file to a regular HTML document (with linked files), edit it with your favorite HTML editor and then export it back to an MHTML archive (including the linked files).

但是,您可以轻松地将 MHTML 文件提取到常规 HTML 文档(带有链接文件),使用您喜欢的 HTML 编辑器对其进行编辑,然后将其导出回 MHTML 存档(包括链接文件)。

Since you're using Internet Explorer, note that you canopen/save between HTML and MHTML files. This can effectively be used to unpack, edit and repack the MHTML archive. Google Chrome can do this as well.

由于您使用的是 Internet Explorer,请注意您可以在 HTML 和 MHTML 文件之间打开/保存。这可以有效地用于解包、编辑和重新打包 MHTML 存档。谷歌浏览器也可以做到这一点。

You may also find software that are able to edit the MHTML file directly (doing the unpacking/repacking in the background). Microsoft Word seems to be able to do this, but depending on your document structure, it may impact the content layout.

您还可以找到能够直接编辑 MHTML 文件的软件(在后台进行解包/重新打包)。Microsoft Word 似乎能够做到这一点,但根据您的文档结构,它可能会影响内容布局。

回答by Djimmr

A quick look at the wikipedia entry for MHTML shows that it's an archive format, a little bit like a zip or rar archive. In order to edit a .mht you will need to unpack it, edit the required file then repack the archive.

快速浏览一下 MHTML 的维基百科条目,就会发现它是一种存档格式,有点像 zip 或 rar 存档。为了编辑 .mht,您需要解压缩它,编辑所需的文件,然后重新打包存档。

You don't say what platform/software you are using but if you do a websearch for ".mht unpacker" you should be able to find something to do the job.

你没有说你正在使用什么平台/软件,但如果你对“.mht unpacker”进行网络搜索,你应该能够找到一些东西来完成这项工作。

回答by look

Unpacking a .mht to a local folder, edit the code and re-save it to .mht won't work. If you save to .mht from a local drive none of the linked files (pictures and whatever else is used for the page other than included within the html file) will be stored in the container.

将 .mht 解压缩到本地文件夹,编辑代码并将其重新保存到 .mht 将不起作用。如果您从本地驱动器保存到 .mht,则没有任何链接文件(图片和除包含在 html 文件中之外的页面使用的任何其他文件)将存储在容器中。

回答by Ion-Christopher

WizBrother.com WizHtmlEditor is a super capable fast and light wysiwyg editor that is ideal for quick assembly of elements because it can accept almost anything you throw at it - an entire screen of formatted html including pictures, rtf, drag-n-drop from a browser, and from clipboard, even media files. It doesn't care if it's editing MHT or HTML or several other formats. It's free - and they have a bulk converter BTW. Do a search and see.

WizBrother.com WizHtmlEditor 是一个超级强大的快速轻便的所见即所得编辑器,非常适合快速组装元素,因为它几乎可以接受你扔给它的任何东西 - 整个屏幕的格式化 html,包括图片、rtf、从浏览器,从剪贴板,甚至媒体文件。它并不关心它是在编辑 MHT 或 HTML 还是其他几种格式。它是免费的 - 他们有一个批量转换器 BTW。进行搜索并查看。

回答by freedeveloper

I used Word (office 365) to open modify and save the changes. Maybe is not a optimal solution but works.

我使用 Word(office 365)打开修改并保存更改。也许不是最佳解决方案,但有效。

回答by Tom Stickel

I just open and edit with Microsoft Word. This is actually the official approved way of doing it BTW.

我只是用 Microsoft Word 打开和编辑。顺便说一句,这实际上是官方批准的做法。