From b8e87b80da7b15c67cea3274c661a86e7b5e4bc6 Mon Sep 17 00:00:00 2001 From: hammadtheone Date: Tue, 20 Oct 2020 19:07:39 -0400 Subject: [PATCH 1/3] Fixing NULL error with glue interpolation --- R/utils.R | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/R/utils.R b/R/utils.R index 92d6973a..6798f19c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -541,6 +541,7 @@ generate_css_dist_html <- function(tagdata, local_path = NULL, prefix = NULL, as_is = FALSE) { + browser() attribs <- names(tagdata) if (!(local)) { if (any(grepl("^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", @@ -548,8 +549,10 @@ generate_css_dist_html <- function(tagdata, perl=TRUE)) || as_is) { if (is.list(tagdata)) glue::glue('') - else - glue::glue('') + else { + interpolated_link <- glue::glue('href="{tagdata}"') + glue::glue('') + } } else stop(sprintf("Invalid URL supplied in external_stylesheets. Please check the syntax used for this parameter."), call. = FALSE) @@ -562,7 +565,8 @@ generate_css_dist_html <- function(tagdata, } else { tagdata <- sub("^/", "", tagdata) - glue::glue('') + interpolated_link <- glue::glue('href="{prefix}{tagdata}?m={modified}"') + glue::glue('') } } } @@ -580,8 +584,10 @@ generate_js_dist_html <- function(tagdata, perl=TRUE)) || as_is) { if (is.list(tagdata)) glue::glue('') - else - glue::glue('') + else { + interpolated_link <- glue::glue('src="{tagdata}"') + glue::glue('') + } } else stop(sprintf("Invalid URL supplied. Please check the syntax used for this parameter."), call. = FALSE) @@ -594,7 +600,8 @@ generate_js_dist_html <- function(tagdata, } else { tagdata <- sub("^/", "", tagdata) - glue::glue('') + interpolated_link <- glue::glue('src="{prefix}{tagdata}?m={modified}"') + glue::glue('') } } } From 1c23ea850310d8662bee2921a7c08b4c106c9982 Mon Sep 17 00:00:00 2001 From: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> Date: Tue, 20 Oct 2020 19:42:38 -0400 Subject: [PATCH 2/3] Update utils.R --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 6798f19c..c9be8e22 100644 --- a/R/utils.R +++ b/R/utils.R @@ -541,7 +541,7 @@ generate_css_dist_html <- function(tagdata, local_path = NULL, prefix = NULL, as_is = FALSE) { - browser() + attribs <- names(tagdata) if (!(local)) { if (any(grepl("^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", From 39ebc3dd1450feb7dad20bb97ab5d8a839f989ad Mon Sep 17 00:00:00 2001 From: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> Date: Tue, 20 Oct 2020 19:46:00 -0400 Subject: [PATCH 3/3] Update utils.R --- R/utils.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index c9be8e22..4d2c3196 100644 --- a/R/utils.R +++ b/R/utils.R @@ -541,7 +541,6 @@ generate_css_dist_html <- function(tagdata, local_path = NULL, prefix = NULL, as_is = FALSE) { - attribs <- names(tagdata) if (!(local)) { if (any(grepl("^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$",