diff options
Diffstat (limited to 'lib/pure/xmltree.nim')
-rw-r--r-- | lib/pure/xmltree.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim index 7621094f3..95b48a850 100644 --- a/lib/pure/xmltree.nim +++ b/lib/pure/xmltree.nim @@ -273,7 +273,7 @@ macro `<>`*(x: expr): expr {.immediate.} = ## Constructor macro for XML. Example usage: ## ## .. code-block:: nimrod - ## <>a(href="http://nimrod-code.org", "Nimrod rules.") + ## <>a(href="http://nimrod-code.org", newText("Nimrod rules.")) ## ## Produces an XML tree for:: ## @@ -334,3 +334,7 @@ proc findAll*(n: PXmlNode, tag: string): seq[PXmlNode] = ## process(imgTag) newSeq(result, 0) findAll(n, tag, result) + +when isMainModule: + assert """<a href="http://nimrod-code.org">Nimrod rules.</a>""" == + $(<>a(href="http://nimrod-code.org", newText("Nimrod rules."))) |