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
Input | Notes | Example |
---|---|---|
HTML code html |
This action leverages the juice NPM package to apply CSS defined in <style>
tags to inline HTML elements.
Example Payload for Convert to Inline CSS
Example Payload for Convert to Inline CSS
{
"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
Input | Notes | Example |
---|---|---|
HTML code html |
Example Payload for Format HTML
Example Payload for Format 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
Input | Notes |
---|---|
URL string / Required url | The URL to fetch HTML content from |
HTML to Plaintext
Convert an HTML document to plaintext | key: htmlToPlaintext
Input | Notes | Example |
---|---|---|
HTML code html |
Strip HTML Tags
Remove all HTML tags from a string | key: stripHtmlTags
Input | Notes | Example |
---|---|---|
HTML code html |