]> git.ipfire.org Git - thirdparty/tornado.git/commit
Modify xhtml_unescape to handle hex numeric refs 1432/head
authorszweep <szweep@gmail.com>
Thu, 23 Apr 2015 18:33:17 +0000 (14:33 -0400)
committerszweep <szweep@gmail.com>
Fri, 24 Apr 2015 16:23:48 +0000 (12:23 -0400)
commit598ffdace41c4ed96eceb98cfcd27388d2f11657
treeb09cb20d1b9829de568dedaea041e630fdfe668c
parent674d7eb506b5569f8be19fd3cd363421dc095af4
Modify xhtml_unescape to handle hex numeric refs

While the existing code handles references like &#32; properly,
it doesn't handle the valid case where the number is specified
in hex. For example 'foo&#32;bar', 'foo&#x20;bar' and 'foo&#X20;bar'
should all decode to 'foo bar'. The changes in escape.py check
for the 'x' and decode appropriately. Also added unit tests for
unescaping strings with numeric references.
tornado/escape.py
tornado/test/escape_test.py