]> git.eshelyaron.com Git - emacs.git/commitdiff
shr.el: Don't render a normal table twice
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 29 Nov 2016 10:20:51 +0000 (10:20 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 29 Nov 2016 10:20:51 +0000 (10:20 +0000)
* lisp/net/shr.el (shr-collect-extra-strings-in-table):
Don't render a table if it is called for the first time,
IOW, recognize it to never be invalid (bug#25051).

lisp/net/shr.el

index 75e55801864dd64129066bbda6ba7ad1e7f001f7..8b1495e72bddcbdde3511a3b7ade2316ea139a45 100644 (file)
@@ -1917,7 +1917,7 @@ flags that control whether to collect or render objects."
   ;; FLAGS becomes (t . nil) if a <tr> clause is found in the children
   ;; of DOM, and becomes (t . t) if a <td> or a <th> clause is found
   ;; and the car is t then.  When a <table> clause is found, FLAGS
-  ;; becomes nil if the cdr is t then.  But if the cdr is nil then,
+  ;; becomes nil if the cdr is t then.  But if FLAGS is (t . nil) then,
   ;; it renders the <table>.
   (cl-loop for child in (dom-children dom) with recurse with tag
           do (setq recurse nil)
@@ -1945,10 +1945,10 @@ flags that control whether to collect or render objects."
                 else if (eq tag 'table)
                   if (cdr flags)
                     do (setq flags nil)
-                  else
+                  else if (car flags)
                     do (setq recurse nil)
                        (shr-tag-table child)
-                  end end end end end end end end end
+                  end end end end end end end end end end
           when recurse
             append (shr-collect-extra-strings-in-table child flags)))