Skip to content

Commit

Permalink
Prune extra <li>
Browse files Browse the repository at this point in the history
  • Loading branch information
nealrichardson committed Apr 12, 2024
1 parent 93d2031 commit 186c9f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
25 changes: 13 additions & 12 deletions R/tags.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#' Search a tag tree:
#' - `filter_tag_tree_chr()` - filters a tag tree based on a regex
#' - `filter_tag_tree_id()` - filters a tag tree based on an id
#' -
#'
#' @export
#' @rdname tags
Expand Down Expand Up @@ -159,7 +158,7 @@ print.connect_tag_tree <- function(x, ...) {
if (is.list(res)) {
connect_tag_tree(res)
} else {
res
res
}
}

Expand All @@ -169,7 +168,7 @@ print.connect_tag_tree <- function(x, ...) {
if (is.list(res)) {
connect_tag_tree(res)
} else {
res
res
}
}

Expand All @@ -179,7 +178,7 @@ print.connect_tag_tree <- function(x, ...) {
warn_once(
"`[` drops the `connect_tag_tree` class. Use `$` or `[[` instead",
id = "[.connect_tag_tree"
)
)
res
}

Expand Down Expand Up @@ -240,7 +239,7 @@ set_content_tags <- function(content, ...) {
}

.get_tag_id <- function(.x) {
if (inherits(.x, "connect_tag_tree") && ! "id" %in% names(.x)) {
if (inherits(.x, "connect_tag_tree") && !"id" %in% names(.x)) {
print(.x)
stop("this tag does not have an 'id'. Is it a tag list?")
}
Expand Down Expand Up @@ -435,7 +434,7 @@ tag_tree <- function(.x) {
}

parse_tags_tbl <- function(x) {
parsed_tags <- purrr::map_dfr(x, ~{
parsed_tags <- purrr::map_dfr(x, ~ {
out <- dplyr::tibble(
id = as.character(.x$id),
name = .x$name,
Expand All @@ -462,13 +461,15 @@ pc <- function(...) {
}

is_latex_output <- function() {
if (!("knitr" %in% loadedNamespaces())) return(FALSE)
if (!("knitr" %in% loadedNamespaces())) {
return(FALSE)
}
get("is_latex_output", asNamespace("knitr"))()
}

is_utf8_output <- function() {
opt <- getOption("cli.unicode", NULL)
if (! is.null(opt)) {
if (!is.null(opt)) {
isTRUE(opt)
} else {
l10n_info()$`UTF-8` && !is_latex_output()
Expand All @@ -479,15 +480,15 @@ is_utf8_output <- function() {
box_chars <- function() {
if (is_utf8_output()) {
list(
"h" = "\u2500", # horizontal
"v" = "\u2502", # vertical
"h" = "\u2500", # horizontal
"v" = "\u2502", # vertical
"l" = "\u2514",
"j" = "\u251C"
)
} else {
list(
"h" = "-", # horizontal
"v" = "|", # vertical
"h" = "-", # horizontal
"v" = "|", # vertical
"l" = "\\",
"j" = "+"
)
Expand Down
2 changes: 2 additions & 0 deletions man/connectapi-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/tags.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 186c9f2

Please sign in to comment.