switch room "tell" to not use string-apend
[mudsync.git] / mudsync / scrubl.scm
index d25200fbcd9d8cd5ede9a460e49eb00012c8d162..2fdd9227b71013309d264b532ee906524df46e19 100644 (file)
   #:use-module (srfi srfi-9)
   #:use-module (sxml simple)
   #:use-module (oop goops)
+  #:use-module (ice-9 vlist)
+  #:use-module (ice-9 vlist)
+  #:use-module (ice-9 hash-table)
   #:export (make-scrubl
             scrubl? scrubl-extend-fields
+            scrubl-write
             scrubl-sxml scrubl-sxml-simple-field))
 
 (define (order-symlist-args symlist-args)
@@ -113,7 +117,9 @@ Pass in optional extra ARGS to the main META-WRITE"
 (define (scrubl-sxml-write scrubl obj)
   (call-with-output-string
     (lambda (p)
-      (sxml->xml (scrubl-write-obj scrubl obj) p))))
+      (sxml->xml
+       (scrubl-write-obj scrubl obj)
+       p))))
 
 
 (define (scrubl-sxml-simple-field sym)
@@ -124,8 +130,19 @@ Pass in optional extra ARGS to the main META-WRITE"
                      (scrubl-write-obj scrubl arg))
                    args))))
 
+(define (scrubl-pre scrubl args)
+  `(span (@ (class "pre-ish"))
+         ,args))
+
 (define scrubl-sxml
   (make-scrubl `((p . ,(scrubl-sxml-simple-field 'p))
-                 (strong . ,(scrubl-sxml-simple-field 'strong)) ; usually bold
-                 (emph . ,(scrubl-sxml-simple-field 'em))) ; usually italicized
+                 (strong . ,(scrubl-sxml-simple-field 'strong))
+                 (bold . ,(scrubl-sxml-simple-field 'strong))
+                 (b . ,(scrubl-sxml-simple-field 'strong))
+                 (em . ,(scrubl-sxml-simple-field 'em))
+                 (i . ,(scrubl-sxml-simple-field 'em))
+                 (br . ,(scrubl-sxml-simple-field 'br))
+                 (pre . ,scrubl-pre)  ;; "pre" style whitespace handling.
+                 (ul . ,(scrubl-sxml-simple-field 'ul))
+                 (li . ,(scrubl-sxml-simple-field 'li)))
                scrubl-sxml-write))