GNU bug report logs -
#73133
29.2; EWW fails to render some webpages
Previous Next
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 #96 received at 73133 <at> debbugs.gnu.org (full text, mbox):
Mattias Engdegård <mattias.engdegard <at> gmail.com> writes:
> 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.
Thank you for picking this up! Makes wonder what I did wrong when
testing, that it worked OK. Will correct it in the next patch.
> 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?
The idea was to match exactly a "modern" doctype declaration, or softly
a legacy one since they are more likely to have...wonky? markup.
> ..................................................^^
> Useless backslash(es) here. Did you mean to include something else?
> (Relint found this one, which is what brought me here.)
I don't think so, it is an honest mistake. I rarely write regexps in
elisp code (or any code, for that matter :) haha), only interactive use
> .............................................................^
> 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.
This is correct (just read on non-capturing groups).
> ..................................................^^^^^^^^
> A character alternative would be better here: ["'].
>
> An exact translation of your regexp to the rx notation might be:
Despite all the mistakes in the regex above, and a few tries to
understand it, the rx notation doesn't really click for me.
I am more than happy to use either of the versions you provided.
Thank you for your review!
--
Sebastián Monía
https://site.sebasmonia.com/
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.