diff --git a/lisp/org-exp.el b/lisp/org-exp.el index fa54242..b4f6338 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2160,20 +2160,24 @@ can work correctly." (defun org-export-get-title-from-subtree () "Return subtree title and exclude it from export." (let ((rbeg (region-beginning)) (rend (region-end)) - (inhibit-read-only t) title) + (inhibit-read-only t) + (tags (plist-get org-export-opt-plist :tags)) + title) (save-excursion (goto-char rbeg) (when (and (org-at-heading-p) (>= (org-end-of-subtree t t) rend)) ;; This is a subtree, we take the title from the first heading (goto-char rbeg) - (looking-at org-todo-line-regexp) - (setq title (match-string 3)) + (looking-at org-todo-line-tags-regexp) + (setq title (if (eq tags t) + (format "%s\t%s" (match-string 3) (match-string 4)) + (match-string 3))) (org-unmodified (add-text-properties (point) (1+ (point-at-eol)) (list :org-license-to-kill t))) - (setq title (or (org-entry-get nil "EXPORT_TITLE") title)))) - title)) + (setq title (or (org-entry-get nil "EXPORT_TITLE") title)) + title)))) (defun org-solidify-link-text (s &optional alist) "Take link text and make a safe target out of it."