From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Gilstrap Subject: Unexpected link behavior after exporting Org-mode file to HTML Date: Thu, 18 Sep 2014 10:09:12 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdKs-0008OD-Ve for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 11:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUdKg-00046i-F8 for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 11:09:30 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:49288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdKg-00043U-9X for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 11:09:18 -0400 Received: by mail-wi0-f178.google.com with SMTP id ho1so1391512wib.17 for ; Thu, 18 Sep 2014 08:09:12 -0700 (PDT) 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: emacs-orgmode@gnu.org 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: **** <>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