Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-line bibtex entries break import #26

Open
LukasWallrich opened this issue Jan 26, 2023 · 0 comments
Open

Single-line bibtex entries break import #26

LukasWallrich opened this issue Jan 26, 2023 · 0 comments

Comments

@LukasWallrich
Copy link

parse_bibtex appears to attempt to skip entries with fewer than 4 lines. However, it does not do so successfully, so that the following import breaks. Possibly, it should if such entries are deemed to be invalid - but then an explicit error message would be helpful.

library(synthesisr)

bib <- "
@article{5,
  author = {Altman, Irwin and Haythorn, William},
  title = {The Effects of Social Isolation and Group Composition on Performance},
  journal = {Human Relations},
  publisher = {SAGE Publications},
  date = {1967-11},
  year = {1967},
  month = {11},
  pages = {313-340},
  volume = {20},
  number = {4},
  doi = {10.1177/001872676702000401}
}

@misc{6,
  author = {Williams, Katherine and Reilly, Charles and Ill}
}"

t <- tempfile(fileext = ".bib")
writeLines(bib, t)

res <- read_ref(t)
#> Error in names(x_final) <- ref_names: 'names' attribute [2] must be the same length as the vector [1]

Created on 2023-01-26 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant