HTML to Markdown
Verb: htmlToMarkdown
Available from: <Standard>
Converts specific HTML text to Markdown format according to the settings specified.
Syntax
htmlToMarkdown --html(String) [--unknowntags(HtmlToMarkdownUnknownTagsOption)] [--escapetext(Boolean)] [--removecomments(Boolean)] [--tablewithoutheader(HtmlToMarkdownTableWithoutHeaderRowHandlingOption)] [--smarthref(Boolean)] (Boolean)=success (String)=value
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --html | HTML | Required | Text | Text in HTML format that should be converted to Markdown. |
| --unknowntags | Unknown Tags | Optional | HtmlToMarkdownUnknownTagsOption | Options that determine the action to be taken when unknown tags are present in the HTML text:
|
| --escapetext | Escape Text | Optional | Boolean | When enabled, uses escape characters for the special characters "*" and "_" from the formatted text to the Markdown standard. |
| --removecomments | Remove Comments | Optional | Boolean | When enabled, removes comment tags found in the HTML text. |
| --tablewithoutheader | Table Without Header | Optional | HtmlToMarkdownTableWithoutHeaderRowHandlingOption | Options for determining the action to be taken when headerless tables are present in HTML text:
|
| --smarthref | Smart Href | Optional | Boolean | When enabled, uses a method for evaluating the content of the tag "<a>" found in the HTML text, performing the following validations:
|
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| success | Success | Boolean | Returns "True" if the conversion from HTML text to Markdown was completed successfully, or "False" otherwise. |
| value | Text | Text | Returns the HTML text converted to Markdown format. |
Example
The command converts the HTML text to Markdown format, with the parameter Smart Href enabled.
defVar --name markdownText --type String
defVar --name success --type Boolean
htmlToMarkdown --html "Insert Html text here." --unknowntags "Write" --escapetext --tablewithoutheader "EmptyRow" --smarthref success=success markdownText=value
logMessage --message "${success}\r\n${markdownText}" --type "Info"
Download File