emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chris Hunt <chrahunt@gmail.com>
To: "Juan Manuel Macías" <maciaschain@posteo.net>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Bug: Tildes in URL impact visible link text [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
Date: Sun, 27 Dec 2020 18:54:06 -0500	[thread overview]
Message-ID: <CAH+Wm49URRddVahBFE8fzrhFczKfLyCT8ZogBttt6Kmkpsx4Cg@mail.gmail.com> (raw)
In-Reply-To: <87eejbunhh.fsf@posteo.net>

> If it's just that case, you can try replacing each
> tilde with %7E (see
> https://www.w3schools.com/tags/ref_urlencode.asp). That way the
> link description would have to be formatted correctly, without spurious
> characters.

That's a good workaround, thank you. Manually replacing "~" in the URL
with "%7E" results in the expected
description ("metrics"). Using that link in Firefox navigates to the
page successfully, too.

I looked at the problem some more. I think the underlying behavior
leading to the bug is that `org-activate-links` sets an
`invisible` text property on the URL and brackets of link text.
`org-activate-code`, which runs afterwards, identifies
"code" in a way that isn't aware of links, then proceeds to drop the
"invisible" property. That behavior makes sense,
since in the usual case we're removing properties so the text is
displayed verbatim, but not when the whole text is contained
in the URL section of a link.


      parent reply	other threads:[~2020-12-27 23:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 16:44 Bug: Tildes in URL impact visible link text [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Chris Hunt
2020-12-27 18:12 ` Juan Manuel Macías
2020-12-27 20:14   ` tomas
2020-12-27 21:33     ` Juan Manuel Macías
2020-12-27 23:54   ` Chris Hunt [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.orgmode.org/

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

  git send-email \
    --in-reply-to=CAH+Wm49URRddVahBFE8fzrhFczKfLyCT8ZogBttt6Kmkpsx4Cg@mail.gmail.com \
    --to=chrahunt@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maciaschain@posteo.net \
    /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/org-mode.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).