Fixing PR 12271
This commit is contained in:
parent
c805728d3e
commit
354283132d
16
collects/tests/web-server/pr/12271.rkt
Normal file
16
collects/tests/web-server/pr/12271.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang racket
|
||||
(require tests/eli-tester
|
||||
xml)
|
||||
|
||||
(test
|
||||
(with-output-to-bytes
|
||||
(lambda ()
|
||||
(write-xexpr
|
||||
`(html (head (title "Form with CDATA"))
|
||||
(body (p "Hello, this is a form")
|
||||
(p ,(cdata 'cdata-start 'cdata-end "<![CDATA[foo]]>"))
|
||||
(p ,(p-i 'pis 'pie 'target "instruction"))
|
||||
(p ,(comment "comment"))
|
||||
"Something")))))
|
||||
=>
|
||||
#"<html><head><title>Form with CDATA</title></head><body><p>Hello, this is a form</p><p><![CDATA[foo]]></p><p><?target instruction?></p><p><!--comment--></p>Something</body></html>")
|
|
@ -169,6 +169,9 @@
|
|||
escape-table
|
||||
escape-attribute-table
|
||||
lowercase-symbol
|
||||
write-xml-cdata
|
||||
write-xml-comment
|
||||
write-xml-p-i
|
||||
write-xml-element)
|
||||
|
||||
;; incr : Nat -> Nat
|
||||
|
|
|
@ -299,5 +299,9 @@
|
|||
[(valid-char? x)
|
||||
(fprintf out "&#~a;" x)]
|
||||
; Embedded XML
|
||||
[(source? x)
|
||||
(write-xml-element x 0 void out)]))
|
||||
[(cdata? x)
|
||||
(write-xml-cdata x 0 void out)]
|
||||
[(comment? x)
|
||||
(write-xml-comment x 0 void out)]
|
||||
[(p-i? x)
|
||||
(write-xml-p-i x 0 void out)]))
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
escape-table
|
||||
escape-attribute-table
|
||||
lowercase-symbol
|
||||
write-xml-cdata
|
||||
write-xml-comment
|
||||
write-xml-p-i
|
||||
write-xml-element)
|
||||
"private/xexpr.rkt"
|
||||
"private/syntax.rkt")
|
||||
|
|
Loading…
Reference in New Issue
Block a user