discard """ output: true """ import htmlparser import xmltree import strutils from streams import newStringStream ## 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"