[gnus git] branch master updated: n0-17-328-g0384848 =1= * shr.el (shr-tag-table): Render totally broken tables better.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  0384848978803e44b53f2e14b0f62a2d3d97f0bd (commit)
      from  806ccd896de59c1765195883cebd8f4cee1702b0 (commit)


- Log -----------------------------------------------------------------
commit 0384848978803e44b53f2e14b0f62a2d3d97f0bd
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Sep 26 22:55:15 2011 +0200

    * shr.el (shr-tag-table): Render totally broken tables better.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f23bad7..79577df 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2011-09-26  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* shr.el (shr-tag-table): Render totally broken tables better.
+
 	* mml.el (mml-generate-mime-1): Don't alter the contents if we're
 	computing the boundary.
 
diff --git a/lisp/shr.el b/lisp/shr.el
index fc2f577..f49bbd6 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -1055,6 +1055,15 @@ ones, in case fg and bg are nil."
 	 (nheader (if header (shr-max-columns header)))
 	 (nbody (if body (shr-max-columns body)))
 	 (nfooter (if footer (shr-max-columns footer))))
+    (if (and (not caption)
+	     (not header)
+	     (not (cdr (assq 'tbody cont)))
+	     (not (cdr (assq 'tr cont)))
+	     (not footer))
+	;; The table is totally invalid and just contains random junk.
+	;; Try to output it anyway.
+	(shr-generic cont)
+      ;; It's a real table, so render it.
     (shr-tag-table-1
      (nconc
       (if caption `((tr (td ,@caption))))
@@ -1092,7 +1101,7 @@ ones, in case fg and bg are nil."
 		       `((tr (td (table (tbody ,@footer))))))))
 	  (if caption
 	      `((tr (td (table (tbody ,@body)))))
-	    body)))))
+	      body))))))
     (when bgcolor
       (shr-colorize-region start (point) (cdr (assq 'color shr-stylesheet))
 			   bgcolor))))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    2 +
 lisp/shr.el    |   83 +++++++++++++++++++++++++++++++-------------------------
 2 files changed, 48 insertions(+), 37 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.