Fix #2885: convert number entity to character

This commit is contained in:
Sorawee Porncharoenwase 2019-11-01 21:12:31 -07:00 committed by Jay McCarthy
parent e8f5501e29
commit 45968e8a3c
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
#lang racket/base
(require xml)
(module+ test
(require rackunit)
(define ex #<<EOF
<?xml version="1.0"?>
<blah foo="1 &amp;&#13;&#10;2" />
EOF
)
(check-equal?
(xml->xexpr (document-element (read-xml (open-input-string ex))))
'(blah ((foo "1 &\r\n2")))))

View File

@ -180,7 +180,7 @@
[(gt) ">"]
[(quot) "\""]
[(apos) "'"]
[else #f]))
[else (and (number? name) (string (integer->char name)))]))
(define-struct (EOF source) ())