Skip to content

Commit

Permalink
Remove requirement on magrittr pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
froggleston committed Oct 17, 2024
1 parent 1485f0e commit fad4e9f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/build_glossary.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,14 @@ build_glossary_page <- function(pkg, pages, title = "Glosario Links", slug = NUL
get_glossary_links <- function(episode) {
lang <- this_metadata$get()[["lang"]]
links <- xml2::xml_find_all(episode, ".//a")
links <- links[xml2::xml_attr(links, "href") %>%
stringr::str_detect("^https://glosario.carpentries.org/")]
hrefs <- xml2::xml_attr(links, "href")
glos_links <- links[stringr::str_detect(hrefs, "^https://glosario.carpentries.org/")]

#links <- links[xml2::xml_attr(links, "href") %>%
# stringr::str_detect("^https://glosario.carpentries.org/")]

clean_links <- character()
for (link in links) {
for (link in glos_links) {
href <- xml2::xml_attr(link, "href")
xml2::xml_attr(link, "href") <- stringr::str_replace_all(href, "en/", lang)
clean_links <- c(clean_links, href)
Expand Down

0 comments on commit fad4e9f

Please sign in to comment.