diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 3dadcb9a09b..fb72ea6aa67 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -2261,8 +2261,9 @@ See `outline-search-function' for BOUND, MOVE, BACKWARD and LOOKING-AT." (defun shr--fix-tbody (tbody) (nconc (list 'tbody (dom-attributes tbody)) (cl-loop for child in (dom-children tbody) - collect (if (or (stringp child) - (not (eq (dom-tag child) 'tr))) + for tag = (and (not (stringp child)) (dom-tag child)) + unless (or (eq tag 'thead) (eq tag 'tfoot)) + collect (if (not (eq tag 'tr)) (list 'tr nil (list 'td nil child)) child)))) diff --git a/test/lisp/net/shr-resources/table.html b/test/lisp/net/shr-resources/table.html new file mode 100644 index 00000000000..c5e8875ac91 --- /dev/null +++ b/test/lisp/net/shr-resources/table.html @@ -0,0 +1,7 @@ +
| A | B |
|---|---|
| 1 | 2 |
| 3 | 4 |
| A | B |