diff options
| -rw-r--r-- | lisp/net/shr.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 64263903bdf..dc3cc38c798 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -1993,8 +1993,16 @@ BASE is the URL of the HTML being rendered." | |||
| 1993 | `(tbody nil ,@(cl-reduce 'append | 1993 | `(tbody nil ,@(cl-reduce 'append |
| 1994 | (mapcar 'dom-non-text-children tbodies))))))) | 1994 | (mapcar 'dom-non-text-children tbodies))))))) |
| 1995 | 1995 | ||
| 1996 | (defun shr--fix-tbody (tbody) | ||
| 1997 | (nconc (list 'tbody (dom-attributes tbody)) | ||
| 1998 | (cl-loop for child in (dom-children tbody) | ||
| 1999 | collect (if (or (stringp child) | ||
| 2000 | (not (eq (dom-tag child) 'tr))) | ||
| 2001 | (list 'tr nil (list 'td nil child)) | ||
| 2002 | child)))) | ||
| 2003 | |||
| 1996 | (defun shr--fix-table (dom caption header footer) | 2004 | (defun shr--fix-table (dom caption header footer) |
| 1997 | (let* ((body (dom-non-text-children (shr-table-body dom))) | 2005 | (let* ((body (dom-non-text-children (shr--fix-tbody (shr-table-body dom)))) |
| 1998 | (nheader (if header (shr-max-columns header))) | 2006 | (nheader (if header (shr-max-columns header))) |
| 1999 | (nbody (if body (shr-max-columns body) 0)) | 2007 | (nbody (if body (shr-max-columns body) 0)) |
| 2000 | (nfooter (if footer (shr-max-columns footer)))) | 2008 | (nfooter (if footer (shr-max-columns footer)))) |