Convert HTML to Text
Verb: htmlToText
Available from: <Standard>
Converts HTML to text by removing all tags from HTML syntax, returning only the text contained within.
Syntax
htmlToText --html(String) (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--html | HTML | Required | Text | Content in HTML format that should be converted to text. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Text | Text | Returns the text from HTML without HTML tags. |
Example
Converts HTML to text by removing all tags.
defVar --name convertedText --type String
defVar --name htmlText --type String --value "Insert HTML text here."
// Convert HTML to text.
htmlToText --html "${htmlText}" convertedText=value
logMessage --message "${convertedText}" --type "Info"
Download File
Remarks
If the content inserted in the HTML parameter is not in "HTML" format, the return of Text will be the same text inserted.