aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/shr.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 23899521140..0b1a4dac6a4 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1579,12 +1579,23 @@ The preference is a float determined from `shr-prefer-media-type'."
1579 ;; Then render the table again with these new "hard" widths. 1579 ;; Then render the table again with these new "hard" widths.
1580 (shr-insert-table (shr-make-table dom sketch-widths t) sketch-widths))) 1580 (shr-insert-table (shr-make-table dom sketch-widths t) sketch-widths)))
1581 1581
1582(defun shr-table-body (dom)
1583 (let ((tbodies (dom-by-tag dom 'tbody)))
1584 (cond
1585 ((null tbodies)
1586 dom)
1587 ((= (length tbodies) 1)
1588 (car tbodies))
1589 (t
1590 ;; Table with multiple tbodies. Convert into a single tbody.
1591 `(tbody nil
1592 ,@(reduce 'append (mapcar 'dom-non-text-children tbodies)))))))
1593
1582(defun shr-tag-table (dom) 1594(defun shr-tag-table (dom)
1583 (shr-ensure-paragraph) 1595 (shr-ensure-paragraph)
1584 (let* ((caption (dom-children (dom-child-by-tag dom 'caption))) 1596 (let* ((caption (dom-children (dom-child-by-tag dom 'caption)))
1585 (header (dom-non-text-children (dom-child-by-tag dom 'thead))) 1597 (header (dom-non-text-children (dom-child-by-tag dom 'thead)))
1586 (body (dom-non-text-children (or (dom-child-by-tag dom 'tbody) 1598 (body (dom-non-text-children (shr-table-body dom)))
1587 dom)))
1588 (footer (dom-non-text-children (dom-child-by-tag dom 'tfoot))) 1599 (footer (dom-non-text-children (dom-child-by-tag dom 'tfoot)))
1589 (bgcolor (dom-attr dom 'bgcolor)) 1600 (bgcolor (dom-attr dom 'bgcolor))
1590 (start (point)) 1601 (start (point))