GNU bug report logs - #68913
[PATCH] Fix browse-url-url-at-point so that scheme does not duplicate

Previous Next

Package: emacs;

Reported by: Kenta USAMI <zonuexe <at> zonu.me>

Date: Sat, 3 Feb 2024 19:19:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Kenta USAMI <zonuexe <at> zonu.me>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix browse-url-url-at-point so that scheme does not duplicate
Date: Sun, 4 Feb 2024 04:17:29 +0900
[Message part 1 (text/plain, inline)]
Hi,

In the text below, move point to the second half of the URL and
execute M-x browse-url-at-point.

```
[![Emacs](
https://www.gnu.org/software/emacs/images/emacs.png)](https://www.gnu.org/software/emacs/download.html
)
```

Firefox and Chromium-based browsers appear to open the URL "https//
www.gnu.org/software/emacs/download.html".
It seems that the ":" following https is deleted, but the browser actually
normalizes
the URL with the duplicate scheme "http://https://".

You can check this by executing M-: (browse-url-url-at-point).

Because thing-at-point-bounds-of-url-at-point function cannot correctly
recognize
URL bounds in the text.

I considered changing the thing-at-point-bounds-of-url-at-point algorithm,
but it would be a pain to change it without negatively impacting the
current behavior.
Ideally, thing-at-point-bounds-of-url-at-point will be fixed eventually,
but for now, the attached patch should easily fix the problem.
[Message part 2 (text/html, inline)]
[0001-Fix-browse-url-url-at-point-so-that-scheme-does-not-.patch (application/octet-stream, attachment)]

This bug report was last modified 1 year and 100 days ago.

Previous Next


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