fixed a long standing xml parser bug; html parser bugfixes + speed improvements
This commit is contained in:
parent
ff1d68c50b
commit
a674c039fb
7 changed files with 252 additions and 84 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue