Resources »

Solutions Hub »

Automations »

Convert HTML to Markdown

Using |html_to_text filter

Here is an example of using the |html_to_text filter to convert HTML content into Markdown format.

  • 
    start:
      set:
        message_html@text:
          <html><body><h1>Title</h1>This is an <b>HTML</b> message</body></html>
      return:
        output: {{message_html|html_to_text(truncate=50000)}}
    
    
  • 
    __return:
      output: |-
        # Title
        This is an HTML message