--- shr.el~ 2016-11-01 02:35:57.788777000 +0000 +++ shr.el 2016-11-01 09:51:32.251984400 +0000 @@ -1759,6 +1759,7 @@ ;; we then render everything again with the new widths, and finally ;; insert all these boxes into the main buffer. (defun shr-tag-table-1 (dom) + (shr-add-missing-td dom) (setq dom (or (dom-child-by-tag dom 'tbody) dom)) (let* ((shr-inhibit-images t) (shr-table-depth (1+ shr-table-depth)) @@ -1787,6 +1788,19 @@ ;; Then render the table again with these new "hard" widths. (shr-insert-table (shr-make-table dom sketch-widths t) sketch-widths))) +(defun shr-add-missing-td (dom) + "Add missing td tag to table." + (let (tr td) + (dolist (elem (dom-children dom)) + (when (eq (car-safe elem) 'tr) + (setq tr elem + td nil + elem (cddr elem)) + (while (and (not td) elem) + (setq td (eq (car-safe (pop elem)) 'td))) + (unless td + (setcdr (cdr tr) (list (cons 'td (cons nil (cddr tr)))))))))) + (defun shr-table-body (dom) (let ((tbodies (seq-filter (lambda (child) (eq (dom-tag child) 'tbody))