1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make sure we always set the ':readable' state when displaying EWW page

* lisp/net/eww.el (eww-display-html): Always set ':readable'.
* test/lisp/net/eww-tests.el (eww-test/readable/reload-resets-readable):
New test.
This commit is contained in:
Jim Porter 2025-07-19 20:24:32 -07:00
parent e35e18ac18
commit 49696b5cd1
2 changed files with 23 additions and 4 deletions

View file

@ -273,5 +273,22 @@ This sets `eww-before-browse-history-function' to
;; Make sure EWW doesn't use "readable" mode here.
(should-not (plist-get eww-data :readable)))))
(ert-deftest eww-test/readable/reload-resets-readable ()
"Test that reloading a page resets the \"readable\" state."
(skip-unless (libxml-available-p))
(eww-test--with-mock-retrieve
(let* ((shr-width most-positive-fixnum)
(shr-use-fonts nil)
(eww-test--response-function
(lambda (_url)
(concat "Content-Type: text/html\n\n"
eww-test--wordy-page))))
(eww "example.invalid")
(eww-readable 'toggle)
(should (plist-get eww-data :readable))
;; Reload the page, and check if the result uses readable view.
(eww-reload)
(should-not (plist-get eww-data :readable)))))
(provide 'eww-tests)
;; eww-tests.el ends here