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
Input
HTML
code
Notes
 
Example
<html><head>   <title>My Webpage</title>   <style>div{color:red;}</style></head><body>   <div>Hello World</div></body></html>

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

Output Example Payload#

{  "data": "<html>\n  <head>\n    <title>My Webpage</title>\n  </head>\n  <body>\n    <div style=\"color: red\">Hello World</div>\n  </body>\n</html>\n"}

Format HTML#

Apply prettier to an HTML document | key: formatHtml

InputNotesExample
Input
HTML
code
Notes
 
Example
<html><head>   <title>My Webpage</title>   <style>div{color:red;}</style></head><body>   <div>Hello World</div></body></html>

Output Example Payload#

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