Skip to content

Commit

Permalink
add @gustavdelius contribution from #1655
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed May 3, 2021
1 parent 120d3c9 commit 55ab097
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* pkgdown's deploy_to_branch() now cleans out the website directory by default (`clean = TRUE`). To revert to previous behaviour, call it with `clean = FALSE`. (#1394)

* pkgdown now supports local searching. It is enabled by default because no set-up is needed for users to
search pkgdown websites. (#1629)
search pkgdown websites. (#1629, with help from @gustavdelius in #1655)

* pkgdown builds a more exhaustive sitemap.xml even for websites built with Bootstrap 3.
This might change Algolia results if you use Algolia for search. (#1629)
Expand Down
10 changes: 3 additions & 7 deletions R/utils.r
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,9 @@ remove_useless_parts <- function(links, pkg) {

get_section_level <- function(section) {
as.numeric(
sub(
"level", "",
regmatches(
xml2::xml_attr(section, "class"),
regexpr("level[1-9]", xml2::xml_attr(section, "class")
)
gsub(
".*section level(\\d+).*", '\\1',
xml2::xml_attr(section, "class")
)
)
)
}

0 comments on commit 55ab097

Please sign in to comment.