mirror of
https://github.com/msberends/AMR.git
synced 2025-07-10 00:23:03 +02:00
mouse-hover fixes
This commit is contained in:
2
R/ab.R
2
R/ab.R
@ -548,7 +548,7 @@ pillar_shaft.ab <- function(x, ...) {
|
||||
|
||||
# add the names to the drugs as mouse-over!
|
||||
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
|
||||
out[!is.na(x)] <- font_url(url = ab_name(x[!is.na(x)]),
|
||||
out[!is.na(x)] <- font_url(url = paste0(x[!is.na(x)], ": ", ab_name(x[!is.na(x)])),
|
||||
txt = out[!is.na(x)])
|
||||
}
|
||||
|
||||
|
5
R/mo.R
5
R/mo.R
@ -583,7 +583,7 @@ mo_cleaning_regex <- function() {
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
pillar_shaft.mo <- function(x, ...) {
|
||||
add_MO_lookup_to_AMR_env()
|
||||
out <- format(x)
|
||||
out <- trimws(format(x))
|
||||
# grey out the kingdom (part until first "_")
|
||||
out[!is.na(x)] <- gsub("^([A-Z]+_)(.*)", paste0(font_subtle("\\1"), "\\2"), out[!is.na(x)], perl = TRUE)
|
||||
# and grey out every _
|
||||
@ -630,7 +630,8 @@ pillar_shaft.mo <- function(x, ...) {
|
||||
|
||||
# add the names to the bugs as mouse-over!
|
||||
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
|
||||
out[!x %in% c("UNKNOWN", NA)] <- font_url(url = mo_name(x[!x %in% c("UNKNOWN", NA)], keep_synonyms = TRUE),
|
||||
out[!x %in% c("UNKNOWN", NA)] <- font_url(url = paste0(x[!x %in% c("UNKNOWN", NA)], ": ",
|
||||
mo_name(x[!x %in% c("UNKNOWN", NA)], keep_synonyms = TRUE)),
|
||||
txt = out[!x %in% c("UNKNOWN", NA)])
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user