summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-11-22 09:26:58 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-11-22 09:48:25 +0100
commit23e6c72133b690711ab0247ae5b15ada4ad2a7e8 (patch)
tree94bb0da670c4d1358f5eee9e5b98964468914040
parent2dcd6dace94b7e88c51592c55841679b72c77838 (diff)
downloadorg-mode-23e6c72133b690711ab0247ae5b15ada4ad2a7e8.tar.gz
ox-html: Fix TOC entries
* lisp/ox-html.el (org-html--format-toc-headline): Add missing headline number in TOC entries. This fixes commit 4c94c4d062ce7aa28bc21301ec34857745029f5c.
-rw-r--r--lisp/ox-html.el27
1 files changed, 16 insertions, 11 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 7edbf2c..12e6bbc 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1980,7 +1980,8 @@ and value is its relative level, as an integer."
(defun org-html--format-toc-headline (headline info)
"Return an appropriate table of contents entry for HEADLINE.
INFO is a plist used as a communication channel."
- (let* ((todo (and (plist-get info :with-todo-keywords)
+ (let* ((headline-number (org-export-get-headline-number headline info))
+ (todo (and (plist-get info :with-todo-keywords)
(let ((todo (org-element-property :todo-keyword headline)))
(and todo (org-export-data todo info)))))
(todo-type (and todo (org-element-property :todo-type headline)))
@@ -2001,19 +2002,23 @@ INFO is a plist used as a communication channel."
(tags (and (eq (plist-get info :with-tags) t)
(org-export-get-tags headline info))))
(format "<a href=\"#%s\">%s</a>"
+ ;; Label.
(org-export-solidify-link-text
(or (org-element-property :CUSTOM_ID headline)
(concat "sec-"
- (mapconcat
- #'number-to-string
- (org-export-get-headline-number headline info)
- "-"))))
- (apply (if (not (eq org-html-format-headline-function 'ignore))
- (lambda (todo todo-type priority text tags &rest ignore)
- (funcall org-html-format-headline-function
- todo todo-type priority text tags))
- #'org-html-format-headline)
- todo todo-type priority text tags :section-number nil))))
+ (mapconcat #'number-to-string headline-number "-"))))
+ ;; Body.
+ (concat
+ (and (not (org-export-low-level-p headline info))
+ (org-export-numbered-headline-p headline info)
+ (concat (mapconcat #'number-to-string headline-number ".")
+ ". "))
+ (apply (if (not (eq org-html-format-headline-function 'ignore))
+ (lambda (todo todo-type priority text tags &rest ignore)
+ (funcall org-html-format-headline-function
+ todo todo-type priority text tags))
+ #'org-html-format-headline)
+ todo todo-type priority text tags :section-number nil)))))
(defun org-html-list-of-listings (info)
"Build a list of listings.