Skip to content

Commit

Permalink
optionally enable parsing TeX
Browse files Browse the repository at this point in the history
We drop properties potentially added by parsebib as some consumers of our output expect plain strings.
  • Loading branch information
malb committed Jan 12, 2024
1 parent bf184cc commit 42a43b3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bibtex-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ This should be a single character."
:group 'bibtex-completion
:type 'string)

(defcustom bibtex-completion-replace-tex nil
"Make use of parsebib's ability to parse TeX and replace it by unicode characters."
:group 'bibtex-completion
:type 'boolean)

(defcustom bibtex-completion-fallback-options
'(("CrossRef (biblio.el)"
. (lambda (search-expression) (biblio-lookup #'biblio-crossref-backend search-expression)))
Expand Down Expand Up @@ -683,7 +688,9 @@ If HT-STRINGS is provided it is assumed to be a hash table."
for entry-type = (parsebib-find-next-item)
while entry-type
unless (member-ignore-case entry-type '("preamble" "string" "comment"))
collect (let* ((entry (parsebib-read-entry entry-type (point) ht-strings))
collect (let* ((entry (substring-no-properties
(parsebib-read-entry entry-type (point) ht-strings nil
bibtex-completion-replace-tex)))
(fields (append
(list (if (assoc-string "author" entry 'case-fold)
"author"
Expand Down

0 comments on commit 42a43b3

Please sign in to comment.