emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: mailing-list-org-mode <emacs-orgmode-mXXj517/zsQ@public.gmane.org>
Subject: [PATCH] Normalize the construction of outline-container DIV ID
Date: Tue, 09 Apr 2013 14:17:30 +0200	[thread overview]
Message-ID: <8761zv3nl1.fsf@somewhere.org> (raw)

Hi,

I found that, when exporting to HTML, outline-container IDs are not always
built the same way:

- if the headline has an Org ID it is build using that ID:
  outline-container-ID;

- if the headline does not have an Org ID, then the outline-container DIV will
  use the headline number instead (outline-container-X) while the ID of the
  inner headline is sec-X.

I propose a patch to always build the outline-container DIV ID the same way by
using the inner headline ID (when exporting to HTML).

Regards,
 Francesco

From 0e84e6ce8b808f15b0b84cc575b6d9eeb9e374b4 Mon Sep 17 00:00:00 2001
From: Francesco Pizzolante <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
Date: Tue, 9 Apr 2013 13:38:19 +0200
Subject: [PATCH] Normalize the construction of outline-container DIV ID

* ox-html.el (org-html-headline): Normalize the construction of
  outline-container DIVs by always using the inner headline ID.

TINYCHANGE
---
 lisp/ox-html.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 39b0ec9..fe7b822 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2194,7 +2194,7 @@ holding contextual information."
 		  "div")
 		(format "outline-container-%s"
 			(or (org-element-property :CUSTOM_ID headline)
-			    section-number))
+			    (concat "sec-" section-number)))
 		(concat (format "outline-%d" level1) (and extra-class " ")
 			extra-class)
 		(format "\n<h%d id=\"%s\">%s%s</h%d>\n"
--
1.7.9

             reply	other threads:[~2013-04-09 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 12:17 Francesco Pizzolante [this message]
2013-04-09 17:05 ` [PATCH] Normalize the construction of outline-container DIV ID Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761zv3nl1.fsf@somewhere.org \
    --to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).