Login
Free Sign Up
Docs
/

Text - Parse HTML to Content

Type identifier: text:parseHTMLToContent Category: Text Operations

Description

Parses HTML string into rich content. Converts HTML elements into structured content nodes including paragraphs, headings, lists, links, and more. Optionally resolves relative URLs in the content.

Input Handles

Handle

Data Type

Required

Description

html

string

Yes

HTML string to parse

resolveURL

string

No

Base URL for relative link resolution

Input Handle Details

html

  • Type: string
  • Notes:

    • Raw HTML content
    • Must be a valid string
    • Throws error if null or not a string

resolveURL

  • Type: string
  • Notes:

    • Provides base URL for resolving relative links

Output Handles

Handle

Data Type

Description

content

Content

Parsed rich content

error

trigger

Triggered on parsing error

Output Handle Details

content

  • Type: Content
  • Notes:

    • Includes paragraphs, headings, links, and lists
    • Empty text nodes are filtered out

Configuration Options

Property

Type

Required

Default

Description

label

string

Yes

"Text - Parse HTML to Content"

Display label for the node

urlForRelativeLinks

object

No

null

Relative link resolution config

Configuration Details

urlForRelativeLinks

  • Type: Object with dynamic and optional url
  • Variants:

    • null: No relative link resolution
    • { dynamic: true }: Use resolveURL input handle
    • { dynamic: false, url: "https://..." }: Use static base URL
  • Notes: Resolves relative href and src attributes

Behaviour

Execution Flow

  1. Resolves html input handle
  2. Validates input is a non-empty string
  3. Determines base URL for relative link resolution
  4. Parses HTML into content fragments
  5. Returns structured content

HTML Conversion

HTML Element

Content Node Type

<p>

paragraph

<h1>-<h6>

heading with level

<ul>, <ol>

list

<li>

list-item

<a>

link

<img>

image

<strong>, <b>

Bold text

<em>, <i>

Italic text

<code>

Code text

Error Handling

Scenario

Behaviour

No HTML provided

Throws error, triggers error

Invalid HTML (not string)

Throws error, triggers error

Parse failure

Triggers error

Examples

Basic HTML Parsing

{
  "type": "text:parseHTMLToContent",
  "data": {
    "label": "Parse Article HTML"
  }
}

With Static Base URL

{
  "type": "text:parseHTMLToContent",
  "data": {
    "label": "Parse with Base URL",
    "urlForRelativeLinks": {
      "dynamic": false,
      "url": "https://example.com"
    }
  }
}

With Dynamic Base URL

{
  "type": "text:parseHTMLToContent",
  "data": {
    "label": "Parse from Source",
    "urlForRelativeLinks": {
      "dynamic": true
    }
  }
}

Connect the source page URL to the resolveURL input handle.

Related pages