extract_text_from_html
Extracts and returns the plain text content from an HTML string, stripping all HTML tags and markup.
Syntax
extract_text_from_html(html_content)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| html_content | string | Yes | A string containing the HTML content to extract text from. |
Returns
Type: string
A string containing the extracted text, cleaned of all HTML tags and trimmed of leading/trailing whitespace.
Examples
Strip HTML from a rich text field:
extract_text_from_html([description])
If description is "<p>Hello <b>World</b></p>", the result is "Hello World".
Clean HTML content before comparison or mapping:
extract_text_from_html("<div><h1>Title</h1><p>Some paragraph text.</p></div>")
Result: "Title Some paragraph text.".
Use with concatenate to build plain text summaries:
concatenate("Summary: ", extract_text_from_html([html_notes]))
Strips HTML from html_notes and prepends a label.
Notes
- This function uses an HTML parser internally, so it handles nested and complex HTML structures.
- The returned text is stripped of leading and trailing whitespace.
- If the input contains no HTML tags, the original text is returned (trimmed).
Comments
0 comments
Please sign in to leave a comment.