all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sebastián Monía" <sebastian@sebasmonia.com>
To: Jim Porter <jporterbugs@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 73133@debbugs.gnu.org, ganimard@tuta.io
Subject: bug#73133: 29.2; EWW fails to render some webpages
Date: Mon, 30 Sep 2024 13:10:59 -0400	[thread overview]
Message-ID: <thqnjzetm5i4.fsf@sebasmonia.com> (raw)
In-Reply-To: <fea8fef5-68a6-4487-7e72-c56cb17d64de@gmail.com> (Jim Porter's message of "Wed, 25 Sep 2024 18:59:18 -0700")

Hello!

I was looking into this today and considering our options.

Jim Porter <jporterbugs@gmail.com> writes:
> On 9/25/2024 1:46 PM, Sebastián Monía wrote:
>> Jim Porter <jporterbugs@gmail.com> writes:
>>> I was actually thinking something more general, like a defcustom named
>>> 'eww-guess-content-type-functions', which would be a list of functions
>>> where the first non-nil result is the guessed Content-Type. That way,
>>> we could extend this to other content types (for example, maybe we'd
>>> want to look for the magic headers for various image formats too; we
>>> don't have to do that in this bug).

We aren't really guessing the content-type, at least in the scope of my
original patch, and probably this bug. We just want to know if the page
is HTML to render it, in these snippets (part of eww-render):

;; original cond
((eww-html-p (car content-type))
   (eww-display-html (or encode charset) url nil point buffer))

;; one possible alternative 
((or (eww-html-p (car content-type))
     ;; alternative mechanism to detect if the page is HTML
     ;; via <doctype...>, or other tests.
     )
   (eww-display-html (or encode charset) url nil point buffer))

We could instead change 'eww-html-p' to accept the content-type, other
headers and buffer. And in that function, as a fallback, call the
functions in 'eww-guess-content-type-functions' and return non-nil for
HTML.

The reason I am suggesting this is that there is no benefit to have a
generic mechanism to detect the Content Type, without heavily modifying
'eww-render'. It only matters in the context of deciding whether to
render the HTML or displaying it as-is, other cases are handled in
eww-render already.

Hope that made sense!

I can always address Eli's comments in the context of my original patch,
too, for a much simpler (and of course, limited) solution.

-- 
Sebastián Monía
https://site.sebasmonia.com/





  reply	other threads:[~2024-09-30 17:10 UTC|newest]

Thread overview: 35+ 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 [this message]
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-11-02 11:35             ` Eli Zaretskii
2024-10-24  3:32   ` Sebastián Monía

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

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

  git send-email \
    --in-reply-to=thqnjzetm5i4.fsf@sebasmonia.com \
    --to=sebastian@sebasmonia.com \
    --cc=73133@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ganimard@tuta.io \
    --cc=jporterbugs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.