9 Dec 19:50
w3-parse.el modification
From: Arjen P. de Vries <Arjen.de.Vries <at> cwi.nl>
Subject: w3-parse.el modification
Newsgroups: gmane.emacs.w3.devel
Date: 2005-12-09 18:51:35 GMT
Subject: w3-parse.el modification
Newsgroups: gmane.emacs.w3.devel
Date: 2005-12-09 18:51:35 GMT
Hi, I use W3 in mh-e to display HTML emails, and since some time it broke regularly on M$ originating emails, that contain tags in other namespaces. I modified w3-parse.el to ignore tags containing ":", a rather ugly hack but my elisp is very limited. Maybe you can use it, or implement a better handling of name-spaces, Regards, Arjen
Index: w3-parse.el
===================================================================
RCS file: /cvsroot/w3/w3/lisp/w3-parse.el,v
retrieving revision 1.21
diff -u -r1.21 w3-parse.el
--- w3-parse.el 4 Dec 2001 15:49:58 -0000 1.21
+++ w3-parse.el 9 Dec 2005 18:41:26 -0000
@@ -2487,16 +2487,24 @@
;; to set a flag if we see an XML declaration and
;; then treat the EMPTY content model differently
;; below.
+ ;; Arjen 2005-12-0: a lookup of w3-p-d-tag-name
+ ;; has to be avoided for elements from non-XHTML
+ ;; namespaces (Just a hack, as namespaces should
+ ;; be handled properly of course)
((looking-at "/>")
(forward-char 2)
- (or ;; XHTML-style empty tag
+ (or
+ ;; elements with namespace contain a : character
+ (string-match ":" (symbol-name w3-p-d-tag-name))
+ ;; XHTML-style empty tag
(eq 'EMPTY
(w3-element-content-model
- (get w3-p-d-tag-name 'html-element-info)))
+ (get w3-p-d-tag-name 'html-element-info)))
;; XHTML empty element which is not ordinarily
;; empty. Simulate by inserting an end tag.
(save-excursion
(insert "</" (symbol-name w3-p-d-tag-name) ">"))))
+
((and (eq ?/ (char-after (point)))
(not w3-p-d-end-tag-p))
;; This is a NET-enabling start-tag.
_______________________________________________ W3-dev mailing list W3-dev <at> gnu.org http://lists.gnu.org/mailman/listinfo/w3-dev
RSS Feed