Commit 803df849 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

* net/shr.el (shr-make-table-1): dom.el changes for table rendering.

parent fc4d2c77
2014-11-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/shr.el (shr-make-table-1): dom.el changes for table rendering.
* dom.el (dom-by-tag): Use `equal' for comparisons so that tags
can be strings.
(dom-elements): Protect against non-text nodes.
......
......@@ -1582,7 +1582,7 @@ The preference is a float determined from `shr-prefer-media-type'."
(shr-inhibit-decoration (not fill))
(rowspans (make-vector (length widths) 0))
width colspan)
(dolist (row (dom-children dom))
(dolist (row (dom-non-text-children dom))
(when (eq (dom-tag row) 'tr)
(let ((tds nil)
(columns (dom-children row))
......@@ -1731,7 +1731,7 @@ The preference is a float determined from `shr-prefer-media-type'."
;; Return a summary of the number and shape of the TDs in the table.
(defun shr-column-specs (dom)
(let ((columns (make-vector (shr-max-columns dom) 1)))
(dolist (row (dom-children dom))
(dolist (row (dom-non-text-children dom))
(when (eq (dom-tag row) 'tr)
(let ((i 0))
(dolist (column (dom-children row))
......@@ -1757,7 +1757,8 @@ The preference is a float determined from `shr-prefer-media-type'."
(defun shr-max-columns (dom)
(let ((max 0))
(dolist (row (dom-children dom))
(when (eq (dom-tag row) 'tr)
(when (and (not (stringp row))
(eq (dom-tag row) 'tr))
(setq max (max max (+ (shr-count row 'td)
(shr-count row 'th))))))
max))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment