discard """ output: ''' @[] true ''' """ import htmlparser import xmltree import strutils from streams import newStringStream block t2813: const html = """ Test ABC
A
B
A
""" var errors: seq[string] = @[] let tree = parseHtml(newStringStream(html), "test.html", errors) echo errors # Errors: expected,... var len = tree.findAll("tr").len # len = 6 var rows: seq[XmlNode] = @[] for n in tree.findAll("table"): n.findAll("tr", rows) # len = 2 break assert tree.findAll("tr").len == rows.len block t2814: ## builds the two cases below and test that ## ``//[dd,li]`` has "

that

" as children ## ##
##
this
##
##

that

##
##
## ## for ltype in [["dl","dd"], ["ul","li"]]: let desc_item = if ltype[0]=="dl": "
this
" else: "" let item = "$1<$2>

that

" % [desc_item, ltype[1]] let list = """ <$1> $2 """ % [ltype[0], item] var errors : seq[string] = @[] let parseH = parseHtml(newStringStream(list),"statichtml", errors =errors) if $parseH.findAll(ltype[1])[0].child("p") != "

that

": echo "case " & ltype[0] & " failed !" quit(2) echo "true"