Skip to main content

HTML Utils Component

Helpful HTML-related functions for building HTML documents and HTML-based emails.

Component key: html-utils

Description

The HTML Utils component provides helpful functions for building and formatting HTML documents.

Actions

Convert to Inline CSS

Convert an HTML document to use inline styles | key: convertInlineCss

InputNotesExample
HTML
code
html
 

This action leverages the juice NPM package to apply CSS defined in <style> tags to inline HTML elements.

{
"data": "<html>\n <head>\n <title>My Webpage</title>\n </head>\n <body>\n <div style=\"color: red;\">Hello World</div>\n <ol>\n <li>First Item</li>\n <li>Second Item</li>\n </ol>\n </body>\n</html>\n"
}

Format HTML

Apply prettier to an HTML document | key: formatHtml

InputNotesExample
HTML
code
html
 

{
"data": "<html>\n <head>\n <title>My Webpage</title>\n <style>\n div{color:red;}\n </style>\n </head>\n <body>\n <div>Hello World</div>\n <ol>\n <li>First Item</li>\n <li>Second Item</li>\n </ol>\n </body>\n</html>\n"
}

Get HTML from URL

Fetch HTML content from a URL | key: getHtmlFromUrl

InputNotes
URL
string
/ Required
url
The URL to fetch HTML content from

HTML to Plaintext

Convert an HTML document to plaintext | key: htmlToPlaintext

InputNotesExample
HTML
code
html
 

Strip HTML Tags

Remove all HTML tags from a string | key: stripHtmlTags

InputNotesExample
HTML
code
html