emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f8db783 2/2: Tweak the eww readability function


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master f8db783 2/2: Tweak the eww readability function
Date: Thu, 12 Apr 2018 18:14:40 -0400 (EDT)

branch: master
commit f8db783d097081d8a679a82c3a748ffb7976c4c1
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Tweak the eww readability function
    
    * lisp/net/eww.el (eww-highest-readability): Require that the
    readable bit is at least 100 words (bug#30445).
---
 lisp/net/eww.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 66b1767..9490d31 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -731,7 +731,10 @@ the like."
                   most-negative-fixnum)
               (or (dom-attr result :eww-readability-score)
                   most-negative-fixnum))
-       (setq result highest)))
+        ;; We set a lower bound to how long we accept that the
+        ;; readable portion of the page is going to be.
+        (when (> (length (split-string (dom-texts highest))) 100)
+         (setq result highest))))
     result))
 
 (defvar eww-mode-map



reply via email to

[Prev in Thread] Current Thread [Next in Thread]