htmlparser: update example
This update htmlparser example to compile with the current stdlib.
This commit is contained in:
parent
e1d17ece5b
commit
78d7ecae90
1 changed files with 3 additions and 3 deletions
|
|
@ -30,6 +30,7 @@
|
|||
## ending with the extension ``.rst`` and convert them to ``.html``.
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## :test:
|
||||
##
|
||||
## import htmlparser
|
||||
## import xmltree # To use '$' for XmlNode
|
||||
|
|
@ -41,9 +42,8 @@
|
|||
## let html = loadHTML("input.html")
|
||||
##
|
||||
## for a in html.findAll("a"):
|
||||
## let href = a.attrs["href"]
|
||||
## if not href.isNil:
|
||||
## let (dir, filename, ext) = splitFile(href)
|
||||
## if a.attrs.hasKey "href":
|
||||
## let (dir, filename, ext) = splitFile(a.attrs["href"])
|
||||
## if cmpIgnoreCase(ext, ".rst") == 0:
|
||||
## a.attrs["href"] = dir / filename & ".html"
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue