w3-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[W3-dev] w3-parse.el modification


From: Arjen P. de Vries
Subject: [W3-dev] w3-parse.el modification
Date: Fri, 09 Dec 2005 19:51:35 +0100

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]