[gnus git] branch master updated: m0-7-126-g567be35 =1= * shr.el (shr-make-table-1): Implement <td rowspan>.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  567be3599871e5760a21e6f30f4e21f03692104d (commit)
      from  39cb12ac94b96e035dcffe7f419eb77b5a41226f (commit)


- Log -----------------------------------------------------------------
commit 567be3599871e5760a21e6f30f4e21f03692104d
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Jun 18 17:32:59 2013 +0200

    * shr.el (shr-make-table-1): Implement <td rowspan>.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0e6e21c..01448df 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-18  Lars Magne Ingebrigtsen  <[email protected]>
+
+	* shr.el (shr-make-table-1): Implement <td rowspan>.
+
 2013-06-18  Tom Tromey  <tromey@barimba>
 
 	* eww.el (eww-next-url, eww-previous-url, eww-up-url, eww-top-url):
diff --git a/lisp/shr.el b/lisp/shr.el
index 1cf978c..060f3f5 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -1435,6 +1435,7 @@ ones, in case fg and bg are nil."
 (defun shr-make-table-1 (cont widths &optional fill)
   (let ((trs nil)
 	(shr-inhibit-decoration (not fill))
+	(rowspans (make-vector (length widths) 0))
 	width colspan)
     (dolist (row cont)
       (when (eq (car row) 'tr)
@@ -1444,9 +1445,21 @@ ones, in case fg and bg are nil."
 	      (width-column 0)
 	      column)
 	  (while (< i (length widths))
-	    (setq column (pop columns))
+	    ;; If we previously had a rowspan definition, then that
+	    ;; means that we now have a "missing" td/th element here.
+	    ;; So just insert a dummy, empty one to (sort of) emulate
+	    ;; rowspan.
+	    (setq column
+		  (if (zerop (aref rowspans i))
+		      (pop columns)
+		    (aset rowspans i (1- (aref rowspans i)))
+		    '(td)))
 	    (when (or (memq (car column) '(td th))
 		      (not column))
+	      (when (cdr (assq :rowspan (cdr column)))
+		(aset rowspans i (+ (aref rowspans i)
+				    (1- (string-to-number
+					 (cdr (assq :rowspan (cdr column))))))))
 	      (setq width
 		    (if column
 			(aref widths width-column)

-----------------------------------------------------------------------
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 |    4 ++++
 lisp/shr.el    |   15 ++++++++++++++-
 2 files changed, 18 insertions(+), 1 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.