首页 > 解决方案 > 在 Google 脚本中将 HTML 转换为纯文本

问题描述

我在 gmail 上收到 HTML 格式的电子邮件,我想用 google 脚本解析正文的文本,我尝试了下面的代码,但 GS 不想调试它。

var temp = document.createElement("div");
temp.innerHTML = html;
return temp.textContent || temp.innerText || "";

在这种情况下,我不知道如何使用 GetText。提前致谢!

标签: google-apps-script

解决方案


推荐阅读