]> gitweb.factorcode.org Git - factor.git/commitdiff
html.components: protect M\ code render* from ``f`` value.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 31 Dec 2016 21:53:56 +0000 (13:53 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 31 Dec 2016 21:53:56 +0000 (13:53 -0800)
basis/html/components/components.factor

index 256fd5950dd8ac2cd64e976dbf2f3043b5d05fb4..46872111d0b45fa3a659eaadb594f4bf11a7e0dc 100644 (file)
@@ -150,8 +150,11 @@ TUPLE: code mode ;
 : <code> ( -- code )
     code new ;
 
+: ?string-lines ( str/f -- seq )
+    [ { } ] [ string-lines ] if-empty ;
+
 M: code render*
-    [ string-lines ] [ drop ] [ mode>> value ] tri* htmlize-lines ;
+    [ ?string-lines ] [ drop ] [ mode>> value ] tri* htmlize-lines ;
 
 ! Farkup component
 TUPLE: farkup no-follow disable-images parsed ;