]> gitweb.factorcode.org Git - factor.git/commitdiff
html.components: For the t:html tag, only wrap strings in unescaped so that other...
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 6 Nov 2011 20:15:00 +0000 (12:15 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 6 Nov 2011 20:15:00 +0000 (12:15 -0800)
basis/html/components/components-tests.factor
basis/html/components/components.factor

index d1d43c762cc7d27ef34c6ef0478185db0d55c156..4609ef634cdb97a9a59dc9ae41a677486012ec45 100644 (file)
@@ -1,7 +1,7 @@
 USING: tools.test kernel io.streams.string
 io.streams.null accessors inspector html.streams
 html.components html.forms namespaces
-xml.writer ;
+xml.writer xml.syntax ;
 FROM: html.components => inspector ;
 IN: html.components.tests
 
@@ -196,3 +196,15 @@ M: link-test link-href drop "http://www.apple.com/foo&bar" ;
 [ ] [
     "error" hidden render
 ] unit-test
+
+! Test xml in html components
+[ ] [
+    [XML <foo/> XML] "xmltest" set-value
+] unit-test
+
+[ "<foo/>" ] [
+    [
+        "xmltest" html render
+    ] with-string-writer
+] unit-test
+
index f4f30ea33f02eccce8fed98abd2f16948504177a..30ad323ae88f13cc8ac56e2c84a5bea7b08263cc 100644 (file)
@@ -190,7 +190,7 @@ M: comparison render*
 ! HTML component
 SINGLETON: html
 
-M: html render* 2drop <unescaped> ;
+M: html render* 2drop dup string? [ <unescaped> ] when ;
 
 ! XML component
 SINGLETON: xml