GNU bug report logs - #73133
29.2; EWW fails to render some webpages

Previous Next

Package: emacs;

Reported by: Ganimard <ganimard <at> tuta.io>

Date: Mon, 9 Sep 2024 04:09:03 UTC

Severity: normal

Found in version 29.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #85 received at 73133 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: Jim Porter <jporterbugs <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 73133 <at> debbugs.gnu.org, ganimard <at> tuta.io
Subject: bug#73133: 29.2; EWW fails to render some webpages
Date: Wed, 23 Oct 2024 12:43:55 +0200
Sebastián, thanks for your contribution! A few minor points about this part:

 663   (let ((case-fold-search t)
 664         (target
 665          "<!doctype +html *\\(>\\|system +\\(\\\"\\|'\\)+about:legacy-compat\\)"))
 666     (with-current-buffer response-buffer

First of all, `case-fold-search` becomes buffer-local if set, so binding it before changing buffer won't help. You need to do it the other way around.

The regexp is a bit muddled. (Carets here apply to the quoted line below.)

 665          "<!doctype +html *\\(>\\|system +\\(\\\"\\|'\\)+about:legacy-compat\\)"))
...................................^
Why match the terminating `>` in one branch (without DOCTYPE legacy string) but not the other?

..................................................^^
Useless backslash(es) here. Did you mean to include something else?
(Relint found this one, which is what brought me here.)

.............................................................^
Why the `+`? According to the reference, there should be one single or double quote here.
(https://html.spec.whatwg.org/multipage/syntax.html#doctype-legacy-string)

................................^^^............^^^
These two capture groups don't seem to be used; you probably meant to use non-capturing \(?:...\) brackets.

..................................................^^^^^^^^
A character alternative would be better here: ["'].

An exact translation of your regexp to the rx notation might be:

  (rx "<!doctype" (+ " ") "html" (* " ")
      (group
       (| ">"
          (: "system" (+ " ") (+ (group (| "\"" "'")))
             "about:legacy-compat"))))

but perhaps you meant something like

  (rx "<!doctype" (+ " ") "html"
      (? (* " ") "system" (+ " ")
         (| "\"" "'") "about:legacy-compat" (| "\"" "'"))
      (* " ") ">")






This bug report was last modified 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.