#:use-module (oop goops)
;; Formatting
- #:use-module (sxml simple)
+ #:use-module (mudsync scrubl)
;; used by web server only
#:use-module (sxml simple)
(define* (nm-send-to-client-id nm message #:key client data)
"Send DATA to TO-CLIENT id"
(define formatted-data
- (call-with-output-string
- (lambda (p)
- (sxml->xml data p))))
+ (scrubl-write scrubl-sxml data))
(define client-obj (hash-ref (nm-clients nm) client))
(match client-obj
(#f (throw 'no-such-client
#: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)
(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)
+ ;; (list 'pre (scrubl-write-obj scrubl obj))
+ p))))
(define (scrubl-sxml-simple-field sym)
(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))
- (br . ,(scrubl-sxml-simple-field 'br))) ; 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)) ;; is this useful?
+ (ul . ,(scrubl-sxml-simple-field 'ul))
+ (li . ,(scrubl-sxml-simple-field 'li)))
scrubl-sxml-write))