HtmlEscape(html) : String?
Escapes special HTML characters.
HtmlEscape Parameters
html : String?
HtmlEscape Examples
var ok = HtmlEscape('a < b') == 'a &lt; b';
HtmlNode(tagname, attrs?, text?) : HtmlNode
Creates HTML element node.
HtmlNode Parameters
tagname : String
HTML tag name (e.g. div).
attrs? : Dict?
HTML attributes to set on the node (e.g. style, class).
text? : String?
Inner text of the node.
HtmlNode Examples
var ok = HtmlNode('div', { class = 'header' }, 'Title').ToString() == '<div class="header">Title</div>';
HtmlSanitize(html) : String?
Removes unsafe HTML markup from HTML fragment.
HtmlSanitize Parameters
html : String
HtmlSanitize Examples
var ok = HtmlSanitize('<div><script></script></div>') == '<div></div>';
HtmlSelect(html, query) : HtmlQuery
Parses HTML content and selects nodes using jQuery-like syntax.
HtmlSelect Parameters
html : Binary?
query : String
HtmlSelect Examples
var ok = HtmlSelect('<div>Hello <span>World</span>!</div>', 'span').Text() == 'World';
HtmlTable(array, options?) : String?
Builds HTML table from array of objects.
HtmlTable Parameters
array : []
options? : Dict?
{ colfmt='{prefix}{col} {i} – ‘, addTableTag = true }
HtmlText(html, formatted = false) : String?
Extracts text from HTML content.
HtmlText Parameters
html : Binary?
formatted : Boolean = false
True to apply simple formatting (e.g. for lists, tables).
HtmlText Examples
var ok = HtmlText('<div>Hello <span>World</span>!</div>') == 'Hello World!';
ParseHtml(html) : HtmlQuery
Parses HTML content to a queryable object.
ParseHtml Parameters
html : Binary?
ParseHtml Examples
var ok = ParseHtml('<div>Hello <span>World</span>!</div>').First().Name == 'div';
ToHtml(object, includeProps?, attrProps?, tagSelector?, getProp?) : HtmlQuery
Converts an object to HTML DOM.
ToHtml Parameters
object : ?
Can be an object, dictionary or array of objects/dicts.
includeProps? : Dict?
Properties to serialize (leave empty to auto detect), name -> label.
attrProps? : Dict?
Properties to include as attributes (if empty then all properties starting with ‘@’ are treated as attributes), name -> attrName.
tagSelector? : Function
Function (item, nameInParent, defaultTag) => tagname or node; nameInParent is null for root objects and array items.
getProp? : Function
Custom function to extract property (item, propName) => value; propName is null for item itself.
WebBrowser(name?) : ?
Returns a web browser engine to execute javascript or render html page.
WebBrowser Parameters
name? : String?