Fixing PR 12271

This commit is contained in:
Jay McCarthy 2011-10-10 06:45:31 -06:00
parent c805728d3e
commit 354283132d
4 changed files with 28 additions and 2 deletions

View 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>")

View File

@ -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

View File

@ -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)]))

View File

@ -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")