Merge pull request #579 from gradha/pr_fixes_xmltree_macro_docstring

Fixes xmltree <> macro docstring.
This commit is contained in:
Araq 2013-08-31 07:33:30 -07:00
commit 84bd794588

View file

@ -273,7 +273,7 @@ macro `<>`*(x: expr): expr {.immediate.} =
## Constructor macro for XML. Example usage: ## Constructor macro for XML. Example usage:
## ##
## .. code-block:: nimrod ## .. 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:: ## Produces an XML tree for::
## ##
@ -334,3 +334,7 @@ proc findAll*(n: PXmlNode, tag: string): seq[PXmlNode] =
## process(imgTag) ## process(imgTag)
newSeq(result, 0) newSeq(result, 0)
findAll(n, tag, result) 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.")))