html library
html library
Function
html standard library is used to process HTML text, providing escaping, anti-escaping, tag stripping and string reading capabilities.
API List
| API | Description |
|---|---|
| html.escape | Escape HTML special characters. |
| html.unescape | Restore common HTML entities. |
| html.strip | Remove HTML tags and keep the text outside the tags. |
| html.to_string | Returns the current HTML raw text. |
Examples
result = html('<p>BT</p>').strip() // Output: BT print result
Notes
- HTML capabilities are migrated from the String prototype to the html standard library to facilitate subsequent expansion of parsing, cleaning, and crawler-related capabilities.