Skip to content

Commit 3a19c44

Browse files
authored
fix: create_absolute_links() ignores <a> tags without href attribute (#2942)
1 parent f1778e3 commit 3a19c44

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

R/build-llm.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ create_absolute_links <- function(main_html, url = NULL) {
181181
xml2::xml_attr(a, "class") <- NULL
182182

183183
href <- xml2::xml_attr(a, "href")
184-
is_internal <- !startsWith(href, "https") & !startsWith(href, "#")
184+
is_internal <- !is.na(href) &
185+
!startsWith(href, "https") &
186+
!startsWith(href, "#")
185187
if (!is.null(url)) {
186188
href[is_internal] <- xml2::url_absolute(href[is_internal], url)
187189
}

0 commit comments

Comments
 (0)