Text - Parse HTML to Content
Type identifier:
text:parseHTMLToContentCategory: 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 |
|---|---|---|---|
|
| Yes | HTML string to parse |
|
| When dynamic | 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
- Required when Dynamic URL is enabled; must be a valid absolute URL
Output Handles
Handle | Data Type | Description |
|---|---|---|
|
| Parsed rich content |
|
| 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 |
|---|---|---|---|---|
|
| Yes |
| Display label for the node |
|
| No |
| Relative link resolution config |
Configuration Details
urlForRelativeLinks
- Type: Object with
dynamicand optionalurl Variants:
null: No relative link resolution{ dynamic: true }: UseresolveURLinput handle{ dynamic: false, url: "https://..." }: Use static base URL
- Notes: Resolves relative
hrefandsrcattributes
Behaviour
Execution Flow
- Resolves
htmlinput handle - Validates input is a non-empty string
- Determines base URL for relative link resolution
- Parses HTML into content fragments
- Returns structured content
HTML Conversion
HTML Element | Content Node Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
| Bold text |
| Italic text |
| Code text |
Error Handling
Scenario | Behaviour |
|---|---|
No HTML provided | Throws error, triggers |
Invalid HTML (not string) | Throws error, triggers |
Parse failure | Triggers |
Invalid dynamic base URL | Triggers |
In v2, parsing failures publish null on content and trigger the connected error route. Without a connected error route, the run fails and no content value is published. Data consumers can receive null while the error route runs; control connections determine which branch executes. HTML is parsed on a best-effort basis; imperfect markup is not necessarily a parsing failure.
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.