* Unexpected link behavior after exporting Org-mode file to HTML
@ 2014-09-18 15:09 Bruce Gilstrap
2014-09-18 20:11 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Gilstrap @ 2014-09-18 15:09 UTC (permalink / raw)
To: emacs-orgmode
Hello,
I am running Org-mode 8.2.7c in Emacs 24.3.1 on Windows 7 Ultimate and
have encountered a peculiarity with how links work in HTML exported
from Org-mode. I searched gmane.emacs.orgmode to see if someone else
has reported this before, but I didn't find anything exactly like
this. Please pardon me if I have missed something.
I have used org-id extensively to assign unique IDs to headings in
Org-mode files (stored in the :PROPERTIES: drawer of the heading).
Before the new exporter framework was introduced in Org-mode 8.0 all
of these links worked without issue: no matter the level of the
heading's hierarchy, exported-HTML ID-based links worked fine.
However, using the new exporter framework produces different results.
Now, ID-based links always fail when the target heading lies at a
level below the headline level defined in the export settings, which
defaults to level 3 (H:3). Note: This is true only for the exported
HTML; ID-based links work perfectly within Emacs.
Here is a minimal example that demonstrates this behavior when I
export it to HTML (see annotations for details):
#+OPTIONS: toc:nil
* Headline Level 1
** Headline Level 2
*** Headline Level 3
:PROPERTIES:
:ID: 307db49e-e001-4a7b-9541-96eee2ae6f06
:END:
**** <<heading-level-4>>Non-headline level
:PROPERTIES:
:ID: 3be9179d-f838-4052-93ca-6c76c9aff12d
:END:
* Headline Level 1
Now I want to link to information that appears elsewhere in the file.
Links work as expected within Emacs. When exported to HTML, however,
links do not work as they did before the new exporter framework was
introduced in Org-mode 8.0.
[[id:307db49e-e001-4a7b-9541-96eee2ae6f06][ID-based link to 1.1.1]]
This link /does/ work. Using IDs always works for links to any
headline level. By "headline level" I mean any Org-mode heading that
is defined as a headline (default H:3).
[[id:3be9179d-f838-4052-93ca-6c76c9aff12d][ID-based link to Non-headline level]]
This link using the ID /doesn't/ work when exported to HTML using the
new exporter framework. Now, using IDs as the target for links
/always/ fails for links to any headline lower than the headline level
defined in the export settings.
[[heading-level-4][Non-ID-based link to Non-headline level]]
Using an internal link works, but I have /many/ existing files that
depend on IDs for links at heading levels lower than the levels I want
treated as (numbered) headlines.
You can view the exported HTML file here:
http://work.gilstraps.org/org/demo-links.html
I believe the relevant function in ox-html.el is org-html-headline,
but I'm a novice (at best) with elisp.
My questions are these:
1. Is this behavior by design?
2. If so, how can I make ID-based links to non-headlines work the way
I expect them to?
3. If not, shouldn't this be treated as a bug?
Thanks,
Bruce
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Unexpected link behavior after exporting Org-mode file to HTML
2014-09-18 15:09 Unexpected link behavior after exporting Org-mode file to HTML Bruce Gilstrap
@ 2014-09-18 20:11 ` Nicolas Goaziou
2014-09-18 21:06 ` Bruce Gilstrap
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2014-09-18 20:11 UTC (permalink / raw)
To: Bruce Gilstrap; +Cc: emacs-orgmode
Hello,
Bruce Gilstrap <bruce@gilstraps.org> writes:
> I am running Org-mode 8.2.7c in Emacs 24.3.1 on Windows 7 Ultimate and
> have encountered a peculiarity with how links work in HTML exported
> from Org-mode. I searched gmane.emacs.orgmode to see if someone else
> has reported this before, but I didn't find anything exactly like
> this. Please pardon me if I have missed something.
>
> I have used org-id extensively to assign unique IDs to headings in
> Org-mode files (stored in the :PROPERTIES: drawer of the heading).
> Before the new exporter framework was introduced in Org-mode 8.0 all
> of these links worked without issue: no matter the level of the
> heading's hierarchy, exported-HTML ID-based links worked fine.
> However, using the new exporter framework produces different results.
> Now, ID-based links always fail when the target heading lies at a
> level below the headline level defined in the export settings, which
> defaults to level 3 (H:3). Note: This is true only for the exported
> HTML; ID-based links work perfectly within Emacs.
This should be fixed. Thank you for reporting it.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Unexpected link behavior after exporting Org-mode file to HTML
2014-09-18 20:11 ` Nicolas Goaziou
@ 2014-09-18 21:06 ` Bruce Gilstrap
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Gilstrap @ 2014-09-18 21:06 UTC (permalink / raw)
To: Bruce Gilstrap, emacs-orgmode
Thank you for fixing it. I have tested it and it works as expected now.
Bruce
On Thu, Sep 18, 2014 at 3:11 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Bruce Gilstrap <bruce@gilstraps.org> writes:
>
>> I am running Org-mode 8.2.7c in Emacs 24.3.1 on Windows 7 Ultimate and
>> have encountered a peculiarity with how links work in HTML exported
>> from Org-mode. I searched gmane.emacs.orgmode to see if someone else
>> has reported this before, but I didn't find anything exactly like
>> this. Please pardon me if I have missed something.
>>
>> I have used org-id extensively to assign unique IDs to headings in
>> Org-mode files (stored in the :PROPERTIES: drawer of the heading).
>> Before the new exporter framework was introduced in Org-mode 8.0 all
>> of these links worked without issue: no matter the level of the
>> heading's hierarchy, exported-HTML ID-based links worked fine.
>> However, using the new exporter framework produces different results.
>> Now, ID-based links always fail when the target heading lies at a
>> level below the headline level defined in the export settings, which
>> defaults to level 3 (H:3). Note: This is true only for the exported
>> HTML; ID-based links work perfectly within Emacs.
>
> This should be fixed. Thank you for reporting it.
>
>
> Regards,
>
> --
> Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-18 21:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 15:09 Unexpected link behavior after exporting Org-mode file to HTML Bruce Gilstrap
2014-09-18 20:11 ` Nicolas Goaziou
2014-09-18 21:06 ` Bruce Gilstrap
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).