unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Sebastián Monía" <sebastian@sebasmonia.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Jim Porter <jporterbugs@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	73133@debbugs.gnu.org, ganimard@tuta.io
Subject: bug#73133: 29.2; EWW fails to render some webpages
Date: Wed, 23 Oct 2024 23:32:37 -0400	[thread overview]
Message-ID: <877c9ygoq2.fsf@sebasmonia.com> (raw)
In-Reply-To: <86613F3D-B7C8-4498-B435-7AAF342264C2@gmail.com> ("Mattias Engdegård"'s message of "Wed, 23 Oct 2024 12:43:55 +0200")

Mattias Engdegård <mattias.engdegard@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/





      parent reply	other threads:[~2024-10-24  3:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08 20:52 bug#73133: 29.2; EWW fails to render some webpages Ganimard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-10  6:06 ` Jim Porter
2024-09-21  9:13   ` Eli Zaretskii
2024-09-21 17:12     ` Jim Porter
2024-09-23 15:43       ` Sebastián Monía
2024-09-28 10:58         ` Eli Zaretskii
2024-09-30 15:52           ` Sebastián Monía
2024-09-23 15:56       ` Sebastián Monía
2024-09-24 18:31         ` Jim Porter
2024-09-25 20:46           ` Sebastián Monía
2024-09-26  1:59             ` Jim Porter
2024-09-30 17:10               ` Sebastián Monía
2024-10-03 23:39                 ` Jim Porter
2024-10-09  3:30                   ` Sebastián Monía
2024-10-09  3:42                     ` Jim Porter
2024-10-10  2:08                       ` Sebastián Monía
2024-10-14  4:35                         ` Jim Porter
2024-10-14 14:03                           ` Eli Zaretskii
2024-10-15 11:43                             ` Sebastián Monía
2024-10-19  7:46                               ` Eli Zaretskii
2024-10-19 17:56                                 ` Sebastián Monía
2024-10-20 19:17                                   ` Jim Porter
2024-10-21  1:48                                     ` Sebastián Monía
2024-10-22  4:59                                       ` Jim Porter
2024-10-22 12:35                                         ` Sebastián Monía
2024-10-22 12:36                                           ` Ganimard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-23 10:43 ` Mattias Engdegård
2024-10-23 16:19   ` Mattias Engdegård
2024-10-23 18:51   ` Jim Porter
2024-10-24  3:35     ` Sebastián Monía
2024-10-24 17:13       ` Sebastián Monía
2024-10-28 15:45         ` Mattias Engdegård
2024-10-30 15:21           ` Sebastián Monía
2024-10-24  3:32   ` Sebastián Monía [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877c9ygoq2.fsf@sebasmonia.com \
    --to=sebastian@sebasmonia.com \
    --cc=73133@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ganimard@tuta.io \
    --cc=jporterbugs@gmail.com \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).