Created
August 5, 2024 04:49
-
-
Save brandonrobertz/7515fa5a7508a47048ff039c875dbe91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extensions -> Apps Script | |
// Make sure to save project (no need to "Deploy") | |
function html2text(html) { | |
const document = XmlService.parse(html); | |
const strText = XmlService.getPrettyFormat().format(document); | |
return strText.replace(/<[^>]*>/g,"").trim(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment