]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure <style> and <template> HTML tags are never "readable" in EWW
authorJim Porter <jporterbugs@gmail.com>
Wed, 2 Jul 2025 01:33:05 +0000 (18:33 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:12:32 +0000 (22:12 +0200)
This helps fix EWW readable mode on some web pages that use these tags,
like the FSF blog.

* lisp/net/eww.el (eww--walk-readability): Check for <style> and
<template> tags.

(cherry picked from commit fa77689b1e352febb2cf9bdd38c595937ae8089e)

lisp/net/eww.el

index c4f26809ddaa8d3c66fa2ac5a8e4fc46109b1e6b..7f7dfa5cfc926cfc55ad5bf05da1d6f6e3a2b8cf 100644 (file)
@@ -1156,7 +1156,7 @@ non-nil, don't actually compute a score; just call the callback."
        ((stringp node)
         (setq score (length (split-string node))
               noscore t))
-       ((memq (dom-tag node) '(script head comment))
+       ((memq (dom-tag node) '(head comment script style template))
         (setq score -2
               noscore t))
        ((eq (dom-tag node) 'meta)