From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Clicking on URL does convert some special characters Date: Wed, 07 Sep 2011 16:01:48 +0530 Message-ID: <8162l41w4r.fsf@gmail.com> References: <80liu0aev0.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1FQq-0004Jt-3K for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1FQo-0006bZ-SX for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:32:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:48331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1FQo-0006bE-IT for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:32:34 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1R1FQg-0003ih-Ow for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 12:32:26 +0200 In-Reply-To: <80liu0aev0.fsf@somewhere.org> (Sebastien Vauban's message of "Wed, 07 Sep 2011 11:20:03 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org > Hello, > > I just realized a diff in behavior between 3 URL entered in the Org buffer > with slight differences: > > - http://web.com/file.php?name=Rep&path=%2FPROJ%2FSomeFile.txt > This one is correctly exported, but when clicking on it from the Org buffer, > the URL opened in the browser is > http://web.com/file.php?name=Rep&path=%252FPROJ%252FSomeFile.txt, > ^^ ^^ > hence path not found error. > > - [[http://web.com/file.php?name=Rep&path=%2FPROJ%2FSomeFile.txt]] > Works OK in Org and in exported HTML file. > > - [[http://web.com/file.php?name=Rep&path=%2FPROJ%2FSomeFile.txt][Description]] > Idem. Same as or 99% similar to https://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00513.html 1. When link is entered through C-c C-l org unescapes it. As a result the link in the buffer IS DIFFERENT from the entered URL. This is a CRITICAL bug. ,---- In org-insert-link | | (setq link (read-string "Link: " | (org-link-unescape | (org-match-string-no-properties 1)))) `---- 2. When the Org buffer is exported to html or odt ,---- In org-html-handle-links | (setq path (save-match-data (org-link-unescape <== | (match-string 3 line)))) | (setq type (cond | ((match-end 2) (match-string 2 line)) | ((save-match-data | (or (file-name-absolute-p path) | (string-match "^\\.\\.?/" path))) | "file") | (t "internal"))) | (setq path (org-extract-attributes (org-link-unescape path))) <== `---- link unescape happens twice. Asymmetry due to One link escape + two link unescape asymmetry creates problem on export. Based on historical research, the second org-link-unescape can be removed. The fact that attributes can be entered at C-c C-l prompt is largely documented and so the second call to org-link-unescape can largely be removed. Jambunathan K. > Best regards, > Seb --