From: David Lichteblau Date: Wed, 15 Jun 2011 12:14:42 +0000 (+0200) Subject: Revert "Clean up attributes before passing them to SAX" X-Git-Url: https://repo.or.cz/w/closure-html.git/commitdiff_plain/6b4c797be0c44aac50bc137cc8f03d31cbac8706 Revert "Clean up attributes before passing them to SAX" This reverts commit ce086ebadb91ae4596197719db8a8132509242ed. --- diff --git a/src/parse/html-parser.lisp b/src/parse/html-parser.lisp index a264004..1fdd457 100644 --- a/src/parse/html-parser.lisp +++ b/src/parse/html-parser.lisp @@ -101,20 +101,16 @@ ;;; (merge-pathnames (or pathname (pathname input)))))) (parse-xstream xstream handler))))) -(defun good-attribute-name-p (name) - (and (cxml::valid-name-p name) - (not (or (string-equal name "xmlns") - (position #\: name))))) - (defun serialize-pt-attributes (plist recode) (loop for (name value) on plist by #'cddr - for n = #+rune-is-character (coerce (symbol-name name) 'rod) - #-rune-is-character (symbol-name name) - ;; don't emit as HAX what would be bogus as SAX anyway - if (good-attribute-name-p n) + unless + ;; better don't emit as HAX what would be bogus as SAX anyway + (string-equal name "xmlns") collect - (let ((v (etypecase value + (let* ((n #+rune-is-character (coerce (symbol-name name) 'rod) + #-rune-is-character (symbol-name name)) + (v (etypecase value (symbol (coerce (string-downcase (symbol-name value)) 'rod)) (rod (funcall recode value)) (string (coerce value 'rod)))))