ox-md: Tiny refactoring

* lisp/ox-md.el (org-md--build-toc): Tiny refactoring.
This commit is contained in:
Nicolas Goaziou 2018-04-21 11:06:13 +02:00
parent c6e5aa1da8
commit 5792f06871
1 changed files with 7 additions and 4 deletions

View File

@ -575,10 +575,13 @@ contents according to the current headline."
(make-string (make-string
(* 4 (1- (org-export-get-relative-level headline info))) (* 4 (1- (org-export-get-relative-level headline info)))
?\s)) ?\s))
(heading-number (org-last (bullet
(org-export-get-headline-number headline info))) (if (not (org-export-numbered-headline-p headline info)) "- "
(number (if heading-number (format "%s." heading-number) "- ")) (let ((prefix
(bullet (concat number (make-string (- 4 (length number)) ?\s))) (format "%d." (org-last (org-export-get-headline-number
headline info)))))
(concat prefix (make-string (max 1 (- 4 (length prefix)))
?\s)))))
(title (title
(format "[%s](#%s)" (format "[%s](#%s)"
(org-export-data-with-backend (org-export-data-with-backend