msprev / fzf-bibtex

a BibTeX source for fzf
BSD 3-Clause "New" or "Revised" License
129 stars 15 forks source link

error with markdown #27

Closed ferdinandyb closed 2 years ago

ferdinandyb commented 2 years ago

I just installed the latest of everything and getting this with the markdown example:

bibtex-ls zotero.bib | fzf --multi --ansi | bibtex-markdown zotero.bib

Miklósi, A (2018) 'Methodological Challenges of the Use of Robots in Ethological Research', *Animal Behav
range [1] with length 1

.parseEntry({0xc0002d3630, 0x3a41})
hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/bibtex/bibtex.go:33 +0x365
.Parse(0xc000057cc8, {0xc00005c4d0, 0xc000020340, 0x40}, 0x4f6398, 0xc0000100e0)
hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/bibtex/bibtex.go:16 +0xf9
RefreshAndDo({0x4ecb21, 0x4}, {0xc00005c4d0, 0x1, 0x1}, {0x4ed56f, 0x8}, 0x203000, 0x203000)
hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/cache/cache.go:80 +0x1a5
ReadAndDo({0x4ecb21, 0x4}, {0xc00005c4d0, 0x1, 0x1}, {0x4ed56f, 0x8}, 0x0, 0xc0000100e0)
hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/cache/cache.go:93 +0x110

hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/cmd/bibtex-markdown/main.go:38

hub.com/msprev/fzf-bibtex@v0.0.0-20211108110920-556b87f29866/cmd/bibtex-markdown/main.go:31 +0xc5

the other example (bibtex-ls references.bib | fzf --multi --ansi | bibtex-cite) works fine. Any idea what is going wrong here?

msprev commented 2 years ago

This looks like a bug... Could you paste here the bibtex entry for Miklósi that is causing the problem and I'll try to reproduce it?

ferdinandyb commented 2 years ago

It seems it does it with any entry, so I uploaded the entire bib file into a gist: https://gist.github.com/ferdinandyb/1401c11cfc177a828ae819cc164a83c8

I'm running

go version go1.17.6 linux/amd64
msprev commented 2 years ago

Thank you! The full .bib file is best, so that is great. I'll have a play around with it and work out what is going on.

msprev commented 2 years ago

Ok, I've worked out that it was one entry in your bibtex file causing the problem. This is the one with the key walterMovementRestingAttack2017. The author field looks corrupt to me, so I'm not surprised that fzf-bibtex choked on it. Do you want to review this entry and see if that solves the problem?

ferdinandyb commented 2 years ago

Indeed, I had to do a bit of cleanup in zotero, but now it is ok, thanks very much for taking the time to check!