You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the function get_length_value_unit doesn't work with decimals (e.g. "1.5em"). I'd suggest modifying the regex a little bit. As a suggestion:
get_length_value_unit <- function(css_length) {
if (!grepl("^[0-9]+(\\.[0-9]+)?[a-z]+$", css_length)) {
stop(
"Values provided to `height` and `width` must have a value followed by a length unit",
call. = FALSE
)
}
unit <- sub("^[0-9]+(\\.[0-9]+)?", "", css_length)
if (!(unit %in% css_length_units)) {
stop(
"The provided CSS length unit is not valid.",
call. = FALSE
)
}
list(
value = as.numeric(sub("[a-z]+$", "", css_length)),
unit = unit
)
}
Cheers.
The text was updated successfully, but these errors were encountered:
It looks like the function
get_length_value_unit
doesn't work with decimals (e.g. "1.5em"). I'd suggest modifying the regex a little bit. As a suggestion:Cheers.
The text was updated successfully, but these errors were encountered: