aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2016-11-29 10:20:51 +0000
committerKatsumi Yamaoka2016-11-29 10:20:51 +0000
commite42b964c1246562a7c2345e528bd0a2fe5448015 (patch)
treed1a72b8b77853fe59a247c9a4e36a52953e902a6
parent2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 (diff)
downloademacs-e42b964c1246562a7c2345e528bd0a2fe5448015.tar.gz
emacs-e42b964c1246562a7c2345e528bd0a2fe5448015.zip
shr.el: Don't render a normal table twice
* 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).
-rw-r--r--lisp/net/shr.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 75e55801864..8b1495e72bd 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1917,7 +1917,7 @@ flags that control whether to collect or render objects."
1917 ;; FLAGS becomes (t . nil) if a <tr> clause is found in the children 1917 ;; FLAGS becomes (t . nil) if a <tr> clause is found in the children
1918 ;; of DOM, and becomes (t . t) if a <td> or a <th> clause is found 1918 ;; of DOM, and becomes (t . t) if a <td> or a <th> clause is found
1919 ;; and the car is t then. When a <table> clause is found, FLAGS 1919 ;; and the car is t then. When a <table> clause is found, FLAGS
1920 ;; becomes nil if the cdr is t then. But if the cdr is nil then, 1920 ;; becomes nil if the cdr is t then. But if FLAGS is (t . nil) then,
1921 ;; it renders the <table>. 1921 ;; it renders the <table>.
1922 (cl-loop for child in (dom-children dom) with recurse with tag 1922 (cl-loop for child in (dom-children dom) with recurse with tag
1923 do (setq recurse nil) 1923 do (setq recurse nil)
@@ -1945,10 +1945,10 @@ flags that control whether to collect or render objects."
1945 else if (eq tag 'table) 1945 else if (eq tag 'table)
1946 if (cdr flags) 1946 if (cdr flags)
1947 do (setq flags nil) 1947 do (setq flags nil)
1948 else 1948 else if (car flags)
1949 do (setq recurse nil) 1949 do (setq recurse nil)
1950 (shr-tag-table child) 1950 (shr-tag-table child)
1951 end end end end end end end end end 1951 end end end end end end end end end end
1952 when recurse 1952 when recurse
1953 append (shr-collect-extra-strings-in-table child flags))) 1953 append (shr-collect-extra-strings-in-table child flags)))
1954 1954