(defun escape-as-html (string &key (escape-whitespace nil)) (with-output-to-string (escaped) (write-as-html string :stream escaped :escape-whitespace escape-whitespace)))