]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/html/parser/printer/printer.factor
html.parser.printer: add helper words with string output.
[factor.git] / extra / html / parser / printer / printer.factor
index 552d807e3ffc10d43fa248d862a4c04c89927dad..4401e1f22946b0c8236b07b766c31e09d37135b1 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors assocs combinators html.parser
-html.parser.utils io kernel math math.order namespaces sequences
-strings unicode.categories ;
+html.parser.utils io io.streams.string kernel math math.order
+namespaces sequences strings unicode.categories ;
 IN: html.parser.printer
 
 TUPLE: html-printer ;
@@ -35,9 +35,15 @@ ERROR: unknown-tag-error tag ;
 : html-text. ( vector -- )
     T{ text-printer } html-printer [ print-tags ] with-variable ;
 
+: html-text ( vector -- string )
+    [ html-text. ] with-string-writer ;
+
 : html-src. ( vector -- )
     T{ src-printer } html-printer [ print-tags ] with-variable ;
 
+: html-src ( vector -- string )
+    [ html-src. ] with-string-writer ;
+
 M: text-printer print-opening-tag
     name>> {
         { "br" [ nl ] }