Skip to content

Commit

Permalink
Bugfix: Fix issue in formatting citations
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalster committed Dec 18, 2019
1 parent 91725e8 commit a2855ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/steps.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ bib_print <- function(bib, .opts = list(first.inits = TRUE, max.names = 1000, st
# set format
oldopts <- RefManageR::BibOptions(.opts)
on.exit(RefManageR::BibOptions(oldopts))

bib %>%
RefManageR:::format.BibEntry(.sort = F) %>%
# HACK: remove some of formatting introduced in line above
# would be nicer if we could apply csl style
gsub("[] ", "", ., fixed = TRUE) %>%
gsub("\\n", "", .) %>%
gsub("\\n", " ", .) %>%
gsub(" ", " ", .) %>%
gsub("DOI:", " doi: ", ., fixed = TRUE) %>%
gsub("URL:", " url: ", ., fixed = TRUE) %>%
ifelse(tolower(bib$bibtype) == "article", gsub("In:", " ", .), .)
Expand Down

0 comments on commit a2855ee

Please sign in to comment.