ox-html: Fix TOC entries

* lisp/ox-html.el (org-html--format-toc-headline): Add missing
  headline number in TOC entries.  This fixes commit
  4c94c4d062.
This commit is contained in:
Nicolas Goaziou 2013-11-22 09:26:58 +01:00
parent 2dcd6dace9
commit 23e6c72133
1 changed files with 16 additions and 11 deletions

View File

@ -1980,7 +1980,8 @@ and value is its relative level, as an integer."
(defun org-html--format-toc-headline (headline info) (defun org-html--format-toc-headline (headline info)
"Return an appropriate table of contents entry for HEADLINE. "Return an appropriate table of contents entry for HEADLINE.
INFO is a plist used as a communication channel." 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))) (let ((todo (org-element-property :todo-keyword headline)))
(and todo (org-export-data todo info))))) (and todo (org-export-data todo info)))))
(todo-type (and todo (org-element-property :todo-type headline))) (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) (tags (and (eq (plist-get info :with-tags) t)
(org-export-get-tags headline info)))) (org-export-get-tags headline info))))
(format "<a href=\"#%s\">%s</a>" (format "<a href=\"#%s\">%s</a>"
;; Label.
(org-export-solidify-link-text (org-export-solidify-link-text
(or (org-element-property :CUSTOM_ID headline) (or (org-element-property :CUSTOM_ID headline)
(concat "sec-" (concat "sec-"
(mapconcat (mapconcat #'number-to-string headline-number "-"))))
#'number-to-string ;; Body.
(org-export-get-headline-number headline info) (concat
"-")))) (and (not (org-export-low-level-p headline info))
(apply (if (not (eq org-html-format-headline-function 'ignore)) (org-export-numbered-headline-p headline info)
(lambda (todo todo-type priority text tags &rest ignore) (concat (mapconcat #'number-to-string headline-number ".")
(funcall org-html-format-headline-function ". "))
todo todo-type priority text tags)) (apply (if (not (eq org-html-format-headline-function 'ignore))
#'org-html-format-headline) (lambda (todo todo-type priority text tags &rest ignore)
todo todo-type priority text tags :section-number nil)))) (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) (defun org-html-list-of-listings (info)
"Build a list of listings. "Build a list of listings.