mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
add text modification proc
This commit is contained in:
@@ -74,6 +74,12 @@ proc text*(n: XmlNode): string {.inline.} =
|
||||
assert n.k in {xnText, xnComment, xnCData, xnEntity}
|
||||
result = n.fText
|
||||
|
||||
proc `text=`*(n: XmlNode, text: string){.inline.} =
|
||||
## sets the associated text with the node `n`. `n` can be a CDATA, Text,
|
||||
## comment, or entity node.
|
||||
assert n.k in {xnText, xnComment, xnCData, xnEntity}
|
||||
n.fText = text
|
||||
|
||||
proc rawText*(n: XmlNode): string {.inline.} =
|
||||
## returns the underlying 'text' string by reference.
|
||||
## This is only used for speed hacks.
|
||||
|
||||
Reference in New Issue
Block a user