Fix #2885: convert number entity to character
This commit is contained in:
parent
e8f5501e29
commit
45968e8a3c
15
pkgs/racket-test/tests/xml/num-entity.rkt
Normal file
15
pkgs/racket-test/tests/xml/num-entity.rkt
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang racket/base
|
||||
(require xml)
|
||||
|
||||
(module+ test
|
||||
(require rackunit)
|
||||
|
||||
(define ex #<<EOF
|
||||
<?xml version="1.0"?>
|
||||
<blah foo="1 & 2" />
|
||||
EOF
|
||||
)
|
||||
|
||||
(check-equal?
|
||||
(xml->xexpr (document-element (read-xml (open-input-string ex))))
|
||||
'(blah ((foo "1 &\r\n2")))))
|
|
@ -180,7 +180,7 @@
|
|||
[(gt) ">"]
|
||||
[(quot) "\""]
|
||||
[(apos) "'"]
|
||||
[else #f]))
|
||||
[else (and (number? name) (string (integer->char name)))]))
|
||||
|
||||
(define-struct (EOF source) ())
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user