From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: [PATCH] Change underscores to hyphens for HTML export Date: Mon, 13 Jun 2011 12:28:05 -0400 Message-ID: <4199.1307982485@alphaville.americas.hpqcorp.net> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW9zk-0002ti-Nm for emacs-orgmode@gnu.org; Mon, 13 Jun 2011 12:28:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW9zj-0008I1-Pa for emacs-orgmode@gnu.org; Mon, 13 Jun 2011 12:28:08 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:15346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW9zj-0008Ho-JB for emacs-orgmode@gnu.org; Mon, 13 Jun 2011 12:28:07 -0400 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0014.houston.hp.com (Postfix) with ESMTP id AF3AB24167 for ; Mon, 13 Jun 2011 16:28:05 +0000 (UTC) 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 Cc: nicholas.dokos@hp.com >From 28c0b3afce11a8e2bd452ccab44b96c00a4401ca Mon Sep 17 00:00:00 2001 From: Nick Dokos Date: Sat, 11 Jun 2011 23:38:09 -0400 Subject: [PATCH] Change underscores to hyphens for HTML export * lisp/org-html.el (org-export-as-html): changed underscores to hyphens in section number. (org-html-level-start): ditto. Daniel Clemente reported that after commit 438536f6157794101ce0957e39cad6bf70580751 which changed underscores to hyphens in org-exp.el, he had problems exporting HTML files that used to work. In particular, org files that used CUSTOM_ID properties were broken. This patch is a minimal fix for this problem: it changes underscores to hyphens in section numbers only. Daniel has tested the fix on an extensive collection of org files and reports that no additional problems have surfaced. There are other places in org-html where underscores are used, so there may be additional problems: if any are found, they should be fairly straightforward to fix (as this problem was). Many thanks to Daniel for findind and reporting the problem and testing the fix on a large collection of his org files. TINYCHANGE Signed-off-by: Nick Dokos --- lisp/org-html.el | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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 -- 1.7.5.1.169.g505a1