Revision: 3711 Author: ksprotte URL: http://bknr.net/trac/changeset/3711
xhtmlgen does not indent anymore U trunk/xhtmlgen/xhtmlgen.lisp
Modified: trunk/xhtmlgen/xhtmlgen.lisp =================================================================== --- trunk/xhtmlgen/xhtmlgen.lisp 2008-07-31 15:57:09 UTC (rev 3710) +++ trunk/xhtmlgen/xhtmlgen.lisp 2008-07-31 16:16:24 UTC (rev 3711) @@ -48,28 +48,31 @@ ;; just emit html to the current stream (let ((body (gensym))) `(labels ((,body () - ,(process-html-forms forms env))) - (if (boundp '*html-sink*) - (,body) - (let ((*html-sink* (cxml:make-character-stream-sink *standard-output* :canonical nil :indentation 3))) - (,body) - (sax:end-document *html-sink*)))))) + ,(process-html-forms forms env))) + (if (boundp '*html-sink*) + (,body) + (let ((*html-sink* (cxml:make-character-stream-sink *standard-output* :canonical t))) + (,body) + (sax:end-document *html-sink*))))))
(defmacro html-stream (stream &rest forms &environment env) - `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical nil :indentation 3))) - ,(process-html-forms forms env) - (sax:end-document *html-sink*))) + `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical t))) + ,(process-html-forms forms env) + (sax:end-document *html-sink*)))
-(defmacro with-xhtml ((&optional stream &key (indentation 3)) &body body) - `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical nil :indentation ,indentation))) - (sax:start-document *html-sink*) - (sax:start-dtd *html-sink* - "html" - "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") - (sax:end-dtd *html-sink*) - (multiple-value-prog1 - (html +(defmacro with-xhtml ((&optional stream &key (indentation 3 indentation-given)) &body body) + (declare (ignore indentation)) + (when indentation-given + (warn "WITH-XHTML: indentation argument is deprecated. It will be ignored")) + `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical t))) + (sax:start-document *html-sink*) + (sax:start-dtd *html-sink* + "html" + "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") + (sax:end-dtd *html-sink*) + (multiple-value-prog1 + (html ,@body) (sax:end-document *html-sink*))))