diff options
author | rumpf_a@web.de <> | 2010-01-31 14:33:33 +0100 |
---|---|---|
committer | rumpf_a@web.de <> | 2010-01-31 14:33:33 +0100 |
commit | e22c73fd893447cc59dd854e9680626ed7da01b2 (patch) | |
tree | f287376afd1cad6e2aa573053e0e8f3e586262eb /lib/pure/parsexml.nim | |
parent | 262a47887d2578c2eb0c2196ea3191b6a088209f (diff) | |
download | Nim-e22c73fd893447cc59dd854e9680626ed7da01b2.tar.gz |
parseutils added
Diffstat (limited to 'lib/pure/parsexml.nim')
-rwxr-xr-x | lib/pure/parsexml.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/pure/parsexml.nim b/lib/pure/parsexml.nim index 343fabd8c..0728d07b1 100755 --- a/lib/pure/parsexml.nim +++ b/lib/pure/parsexml.nim @@ -315,21 +315,22 @@ proc parseEntity(my: var TXmlParser, dest: var string) = r = r * 10 + (ord(buf[pos]) - ord('0')) inc(pos) add(dest, toUTF8(TRune(r))) - elif buf[pos] == 'l' and buf[pos+1] == 't': + elif buf[pos] == 'l' and buf[pos+1] == 't' and buf[pos+2] == ';': add(dest, '<') inc(pos, 2) - elif buf[pos] == 'g' and buf[pos+1] == 't': + elif buf[pos] == 'g' and buf[pos+1] == 't' and buf[pos+2] == ';': add(dest, '>') inc(pos, 2) - elif buf[pos] == 'a' and buf[pos+1] == 'm' and buf[pos+2] == 'p': + elif buf[pos] == 'a' and buf[pos+1] == 'm' and buf[pos+2] == 'p' + and buf[pos+3] == ';': add(dest, '&') inc(pos, 3) elif buf[pos] == 'a' and buf[pos+1] == 'p' and buf[pos+2] == 'o' and - buf[pos+3] == 's': + buf[pos+3] == 's' and buf[pos+4] == ';': add(dest, '\'') inc(pos, 4) elif buf[pos] == 'q' and buf[pos+1] == 'u' and buf[pos+2] == 'o' and - buf[pos+3] == 't': + buf[pos+3] == 't' and buf[pos+4] == ';': add(dest, '"') inc(pos, 4) else: |