diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 498a850b7..bb13620a5 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * org-exp.el (org-export-as-html): Add a "content" div around the entire content of the body tag. + (org-export-html-get-bibliography): New function. * org.el (org-match-sparse-tree): Renamed from `org-tags-sparse-tree'. diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 80e96dfeb..f3b5054c1 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -4047,9 +4047,12 @@ lang=\"%s\" xml:lang=\"%s\"> (or (nth 4 lang-words) "Footnotes") (mapconcat 'identity (nreverse footnotes) "\n")) "\n")) + (let ((bib (org-export-html-get-bibliography))) + (when bib + (insert "\n" bib "\n"))) (unless body-only (when (plist-get opt-plist :auto-postamble) - (insert "
") + (insert "
\n") (when (and org-export-author-info author) (insert "

" (nth 1 lang-words) ": " author "\n") @@ -4170,6 +4173,22 @@ lang=\"%s\" xml:lang=\"%s\"> (if caption (concat "\n

" caption "

") "") (if org-par-open "\n

" "")))))) +(defun org-export-html-get-bibliography () + "Find bibliography, cut it out and return it." + (catch 'exit + (let (beg end (cnt 1)) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^[ \t]*

" nil t) + (setq cnt (+ cnt (if (string= (match-string 0) "") (forward-char 1)) + (setq bib (buffer-substring beg (point))) + (delete-region beg (point)) + (throw 'exit bib)))) + nil)))) (defvar org-table-colgroup-info nil) (defun org-format-table-ascii (lines)