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
(* 4 (1- (org-export-get-relative-level headline info)))
?\s))
(heading-number (org-last
(org-export-get-headline-number headline info)))
(number (if heading-number (format "%s." heading-number) "- "))
(bullet (concat number (make-string (- 4 (length number)) ?\s)))
(bullet
(if (not (org-export-numbered-headline-p headline info)) "- "
(let ((prefix
(format "%d." (org-last (org-export-get-headline-number
headline info)))))
(concat prefix (make-string (max 1 (- 4 (length prefix)))
?\s)))))
(title
(format "[%s](#%s)"
(org-export-data-with-backend