diff options
author | Bastien Guerry <bzg@altern.org> | 2014-05-29 21:21:11 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2014-05-29 21:21:11 +0200 |
commit | db9d63d3139b92a4aaa39cf7a0fe9baaff7fea08 (patch) | |
tree | 15ca50cb18a202e8f97291d3db7b19f26b0e46e9 | |
parent | 017e32c4abdee2666e22b5c175aec9f3655b316f (diff) | |
parent | 34c2365081f6e187b41c54d65db55ab83c78f933 (diff) | |
download | org-mode-db9d63d3139b92a4aaa39cf7a0fe9baaff7fea08.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/ox-md.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/ox-md.el b/lisp/ox-md.el index c34a928..6f9a121 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -193,6 +193,14 @@ a communication channel." (and (plist-get info :with-priority) (let ((char (org-element-property :priority headline))) (and char (format "[#%c] " char))))) + (anchor + (when (plist-get info :with-toc) + (org-html--anchor + (or (org-element-property :CUSTOM_ID headline) + (concat "sec-" + (mapconcat 'number-to-string + (org-export-get-headline-number + headline info) "-")))))) ;; Headline text without tags. (heading (concat todo priority title))) (cond @@ -213,12 +221,12 @@ a communication channel." (replace-regexp-in-string "^" " " contents))))) ;; Use "Setext" style. ((eq org-md-headline-style 'setext) - (concat heading tags "\n" + (concat heading tags anchor "\n" (make-string (length heading) (if (= level 1) ?= ?-)) "\n\n" contents)) ;; Use "atx" style. - (t (concat (make-string level ?#) " " heading tags "\n\n" contents)))))) + (t (concat (make-string level ?#) " " heading tags anchor "\n\n" contents)))))) ;;;; Horizontal Rule |