diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-04-21 11:06:13 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-04-21 11:12:04 +0200 |
commit | 5792f0687174a23bd5d5b2ab9013ca68520e0457 (patch) | |
tree | 8077a67bb1d502f33f7a395d2c05d0a8ab92b092 | |
parent | c6e5aa1da877911d8bd69a8a521cd3b1731d9650 (diff) | |
download | org-mode-5792f0687174a23bd5d5b2ab9013ca68520e0457.tar.gz |
ox-md: Tiny refactoring
* lisp/ox-md.el (org-md--build-toc): Tiny refactoring.
-rw-r--r-- | lisp/ox-md.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 1c72eff..9d7458e 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -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 |