[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Clicking on URL does convert some special characters

From: Jambunathan K
Subject: Re: [O] Clicking on URL does convert some special characters
Date: Wed, 07 Sep 2011 16:01:48 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

> 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

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]