From a2855ee08974eec055d1271d90fc017519f35367 Mon Sep 17 00:00:00 2001 From: Daniel Falster Date: Wed, 18 Dec 2019 17:50:17 +1100 Subject: [PATCH] Bugfix: Fix issue in formatting citations --- R/steps.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/steps.R b/R/steps.R index 97cbee545..447706ff0 100644 --- a/R/steps.R +++ b/R/steps.R @@ -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:", " ", .), .)