Commit f188b667 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

Restore the header line after using `eww-readable'

(eww-readable): Copy over pertinent data from the parent page.
parent 41d4f842
......@@ -4,6 +4,7 @@
to a single page, used throughout the file instead of the
variables `eww-current-url', `eww-current-dom',
`eww-current-source', and `eww-current-title'.
(eww-readable): Copy over pertinent data from the parent page.
* net/eww.el: Remove `eww-next-url', `eww-previous-url',
`eww-up-url', `eww-home-url', `eww-start-url' and
......
......@@ -419,10 +419,10 @@ This command uses heuristics to find the parts of the web page that
contains the main textual portion, leaving out navigation menus and
the like."
(interactive)
(let* ((source (plist-get eww-data :source))
(let* ((old-data eww-data)
(dom (shr-transform-dom
(with-temp-buffer
(insert source)
(insert (plist-get old-data :source))
(condition-case nil
(decode-coding-region (point-min) (point-max) 'utf-8)
(coding-system-error nil))
......@@ -432,7 +432,9 @@ the like."
(eww-display-html nil nil
(shr-retransform-dom
(eww-highest-readability dom)))
(plist-put eww-data :source source)))
(dolist (elem '(:source :url :title :next :previous :up))
(plist-put eww-data elem (plist-get old-data elem)))
(eww-update-header-line-format)))
(defun eww-score-readability (node)
(let ((score -1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment