HTML 文本插入 Microsoft Word 文档书签

发布于 2024-07-20 05:58:18 字数 365 浏览 2 评论 0原文

我有一个小型网络富文本编辑器,具有一些功能,如 bolb、斜体等...

生成的文本是 html,我想将该文本插入到 word 文档书签中。

将文本放入书签不是问题。 但是,由于文本格式(例如粗体),我遇到了问题。

有没有一种快速的方法将文本从html“转换”为doc,或者只是将html包含到word文档中?

这是一个示例:

 <p>Hello <strong>world<strong/></p>

此文本应仅出现在单词书签中“Hello World”。

提前致谢。

I have a small web rich text editor that have some features like bolb, italic, and so on...

The text generated is html, and I would like to insert that text inside a word document bookmarks.

Putting the text into the bookmarks is not a problem. However, I have problems because of the text format (with the bolds for example).

Is there a fast way to "convert" text from html to doc, or just a way to include html into a word document?

This is an exemple:

 <p>Hello <strong>world<strong/></p>

This text should just appear "Hello World" in the word bookmark.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯狂的代价 2024-07-27 05:58:18

将 html 封装在 ... <\body> 中 标签应该可以解决问题。

Enclosing the html in ... <\body> tags should do the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文