emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Link Bug?
@ 2019-01-15 19:21 Scott Randby
  2019-01-15 21:07 ` Marco Wahl
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Randby @ 2019-01-15 19:21 UTC (permalink / raw)
  To: emacs-orgmode

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?

Scott Randby

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Link Bug?
  2019-01-15 19:21 Link Bug? Scott Randby
@ 2019-01-15 21:07 ` Marco Wahl
  2019-01-16  1:58   ` Scott Randby
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Wahl @ 2019-01-15 21:07 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Scott Randby <srandby@gmail.com> 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")]]


HTH
-- 
Marco

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Link Bug?
  2019-01-15 21:07 ` Marco Wahl
@ 2019-01-16  1:58   ` Scott Randby
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Randby @ 2019-01-16  1:58 UTC (permalink / raw)
  To: emacs-orgmode

On 1/15/19 4:07 PM, Marco Wahl wrote:
> Hi,
> 
> Scott Randby <srandby@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-16  1:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 19:21 Link Bug? Scott Randby
2019-01-15 21:07 ` Marco Wahl
2019-01-16  1:58   ` Scott Randby

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).