fixed a long standing xml parser bug; html parser bugfixes + speed improvements

This commit is contained in:
Araq 2013-06-27 01:04:56 +02:00
commit a674c039fb
7 changed files with 252 additions and 84 deletions

View file

@ -71,6 +71,16 @@ proc text*(n: PXmlNode): string {.inline.} =
assert n.k in {xnText, xnComment, xnCData, xnEntity}
result = n.fText
proc rawText*(n: PXmlNode): string {.inline.} =
## returns the underlying 'text' string by reference.
## This is only used for speed hacks.
shallowCopy(result, n.fText)
proc rawTag*(n: PXmlNode): string {.inline.} =
## returns the underlying 'tag' string by reference.
## This is only used for speed hacks.
shallowCopy(result, n.fTag)
proc innerText*(n: PXmlNode): string =
## gets the inner text of `n`. `n` has to be an ``xnElement`` node. Only
## ``xnText`` and ``xnEntity`` nodes are considered part of `n`'s inner text,