From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Randby Subject: Re: Link Bug? Date: Tue, 15 Jan 2019 20:58:00 -0500 Message-ID: <7a5ea01d-23db-fabb-8a7e-f8cd169209f7@gmail.com> References: <84h8e98wal.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:34246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjaTH-0006NT-Se for emacs-orgmode@gnu.org; Tue, 15 Jan 2019 20:58:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjaT6-0001UM-3Y for emacs-orgmode@gnu.org; Tue, 15 Jan 2019 20:58:14 -0500 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:40133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjaSz-0001QZ-9k for emacs-orgmode@gnu.org; Tue, 15 Jan 2019 20:58:08 -0500 Received: by mail-io1-xd34.google.com with SMTP id k2so3698836iog.7 for ; Tue, 15 Jan 2019 17:58:03 -0800 (PST) Received: from ?IPv6:2605:a000:121e:94:b47b:c8d7:f3d3:adfb? ([2605:a000:121e:94:b47b:c8d7:f3d3:adfb]) by smtp.gmail.com with ESMTPSA id x10sm1737953iop.54.2019.01.15.17.58.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 17:58:01 -0800 (PST) In-Reply-To: <84h8e98wal.fsf@gmail.com> Content-Language: en-US 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" To: emacs-orgmode@gnu.org On 1/15/19 4:07 PM, Marco Wahl wrote: > Hi, > > Scott Randby writes: > >> First, I'm using Emacs 26.1 and Org 9.2. >> >> If I have [[./page.html]] in an Org file and I click on the link, >> page.html is opened in my browser, but if I have >> [[./page.html#section]] in the Org file and I click on that link, a >> text file named page.html#section is opened in a buffer instead of a >> page in my browser that starts at the desired place. I'm not sure if >> this is a bug or not, but it isn't the kind of behavior I want. Is >> there any way of getting around this behavior? > > The core of your issue seems to be that one can interpret > "./page.html#section" as filename and also as an anchor in html file > "./page.html". > > Possibly there are clever ways to make the program smarter to detect > links to anchors in html files. > > A way around is to be more explicit in the link. E.g. call a browser > via elisp and use the "file:" protocol: > > [[elisp:(browse-url-firefox "file:///home/webstuff/page.html#section")]] This sort of works, but it doesn't give me the correct link when I export to HTML. I was hoping to check links to anchors in HTML files before exporting to HTML, but maybe that was wishful thinking. Oh well, it is easy enough to check such links after exporting to HTML. I don't know enough elisp to be able to think about making Org smarter. Thanks for the help. Scott