From 94579acc46dc65f187a2148cef8403fbe95f65d3 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 25 Aug 2021 21:45:18 -0400 Subject: [PATCH] Get rid of stringr dependency --- DESCRIPTION | 3 +-- R/replace_html.R | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 08f86f4..a3adabd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,8 +30,7 @@ Imports: curl, rprojroot, magrittr, - yaml, - stringr + yaml Suggests: didactr, knitr, diff --git a/R/replace_html.R b/R/replace_html.R index 7812fc5..bfc7889 100644 --- a/R/replace_html.R +++ b/R/replace_html.R @@ -323,9 +323,8 @@ replace_image_data <- function(x, element = c("img", "iframe"), fullbleed = FALS # If it has a youtube embed link, switch to the watch format link if (grepl("https://www.youtube.com/embed", out$src)) { out$src <- paste0("https://www.youtube.com/watch?v=", - stringr::word(out$src, - sep = "https://www.youtube.com/embed/", - start = 2) + strsplit(out$src, + split = "https://www.youtube.com/embed/")[[1]][2] ) # If it's youtube put this image in the tag out$type <- "video"