From 035b623f686017f6d8aff417f46955cccd1863ce Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Fri, 11 Feb 2022 11:44:19 -0500 Subject: [PATCH] Make the bibliography section regexp a bit more robust The regexp now looks for a blank line to precede the bibliography
section. Right now the div section is inserted by oc-csl like this: ```
``` This updated regex should work in the case that changes to something like below as well: ```
``` --- ox-hugo.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ox-hugo.el b/ox-hugo.el index 9c736bbe..02b1aedd 100644 --- a/ox-hugo.el +++ b/ox-hugo.el @@ -580,7 +580,8 @@ Some of the inbuilt functions that can be added to this list: :group 'org-export-hugo :type '(repeat function)) -(defcustom org-hugo-citations-plist '(:bibliography-section-regexp "\n.*
" +(defcustom org-hugo-citations-plist '(:bibliography-section-regexp "\n\n\\(.\\|\\n\\)*?
" + ;; ^^^^ blank line before the
block :bibliography-section-heading "Bibliography") "Property list for storing default properties for citation exports. @@ -1964,7 +1965,7 @@ holding export options." (level-mark (make-string (+ loffset 1) ?#))) (setq contents (replace-regexp-in-string bib-regexp - (format "\n%s %s\n\\&" level-mark bib-heading) contents))))) + (format "\n\n%s %s\\&" level-mark bib-heading) contents))))) ;; (message "[org-hugo-inner-template DBG] toc-level: %s" toc-level) (org-trim (concat