From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: custom IDs not exported Date: Sat, 11 Jun 2011 23:12:26 -0400 Message-ID: <10721.1307848346@alphaville.dokosmarshall.org> References: <87hb7wq9bc.wl%n142857@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVb6s-0005AE-Iy for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 23:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QVb6r-00031B-Gh for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 23:13:10 -0400 Received: from vms173003pub.verizon.net ([206.46.173.3]:46885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVb6r-000313-DQ for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 23:13:09 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LMN00H6OQ9F6PD0@vms173003.mailsrvcs.net> for emacs-orgmode@gnu.org; Sat, 11 Jun 2011 22:13:04 -0500 (CDT) In-reply-to: Message from Daniel Clemente of "Sun, 12 Jun 2011 00:42:31 +0200." <87hb7wq9bc.wl%n142857@gmail.com> 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: Daniel Clemente Cc: nicholas.dokos@hp.com, org-mode Mailinglist Daniel Clemente wrote: > > Commit 438536f6157794101ce0957e39cad6bf70580751 (=E2=80=9EChange undersco= > res to hyphens in section labels=E2=80=9C) broke the export of CUSTOM_IDs. > > Take for instance this file: > > ----------------------- > #+TITLE: Cosas por hacer > > * Programas > :PROPERTIES: > :CUSTOM_ID: programas > :END: > > ** emacs > :PROPERTIES: > :CUSTOM_ID: emacs > :END: > Editor de textos > > ------------------------ > > > When exporting (C-c C-e H) you get this table of contents: > > ------------------------ >
> >
> > ------------------------- > > The first one is correct because it is first-level. All non-first-level g= > et #sec-NUMBERS instead of the custom ID. > > Not only the table of contents; the header's ID is also wrong: >

ction-number-3">1.1 emacs

> > > Tested with current org-mode.=20 > I was afraid that other exporters might break because of this. Apologies for the inconvenience. And, btw, thanks for the test case. I have a minimal patch that I think fixes this problem, but there are other underscores used in various places in org-html.el so there might be additional problems. I'd appreciate it if you (and/or others) test it and report not only on this problem but on any other problems you find. Thanks, Nick diff --git a/lisp/org-html.el b/lisp/org-html.el index afc6a77..b5d371f 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1395,7 +1395,7 @@ lang=\"%s\" xml:lang=\"%s\"> (setq txt (replace-match "" t t txt))) (setq href (replace-regexp-in-string - "\\." "_" (format "sec-%s" snumber))) + "\\." "-" (format "sec-%s" snumber))) (setq href (org-solidify-link-text (or (cdr (assoc href org-export-preferred-target-alist)) href))) (push (format @@ -2412,7 +2412,7 @@ When TITLE is nil, just close all open levels." (insert "
    \n
  • " title "
    \n")))) (aset org-levels-open (1- level) t) (setq snumber (org-section-number level) - snu (replace-regexp-in-string "\\." "_" snumber)) + snu (replace-regexp-in-string "\\." "-" snumber)) (setq level (+ level org-export-html-toplevel-hlevel -1)) (if (and num (not body-only)) (setq title (concat