X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d1e2b10afa2df313e029b3faeeb0d694fd6e0fbc..574904bbb305c0cda4ee6bda38076f7829a9a253:/lisp/net/eww.el diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 34cb02c24a..6a8400320c 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -669,11 +669,13 @@ the like." (setq score (- (length (split-string (dom-text node)))))) (t (dolist (elem (dom-children node)) - (if (stringp elem) - (setq score (+ score (length (split-string elem)))) + (cond + ((stringp elem) + (setq score (+ score (length (split-string elem))))) + ((consp elem) (setq score (+ score (or (cdr (assoc :eww-readability-score (cdr elem))) - (eww-score-readability elem)))))))) + (eww-score-readability elem))))))))) ;; Cache the score of the node to avoid recomputing all the time. (dom-set-attribute node :eww-readability-score score) score))