Explorar el Código

ox-md: Tiny refactoring

* lisp/ox-md.el (org-md--build-toc): Tiny refactoring.
Nicolas Goaziou hace 7 años
padre
commit
5792f06871
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      lisp/ox-md.el

+ 7 - 4
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