@@ -2369,7 +2369,7 @@ fmt_fraction <- function(
23692369
23702370gcd <- function (x ,y ) {
23712371 r <- x %% y
2372- return ( ifelse(r , gcd(y , r ), y ) )
2372+ ifelse(r , gcd(y , r ), y )
23732373}
23742374
23752375make_frac <- function (x , denom , simplify = TRUE ) {
@@ -7114,7 +7114,7 @@ fmt_tf <- function(
71147114 # If using SVG graphics for either of `true_val` or `false_val` then
71157115 # we'd prefer to have center alignment of the icons
71167116 if (
7117- grepl( " ^ <svg " , true_val ) || grepl( " ^ <svg " , false_val )
7117+ startsWith( true_val , " <svg " ) || startsWith( false_val , " <svg " )
71187118 ) {
71197119 alignment <- " center"
71207120 }
@@ -8263,7 +8263,7 @@ fmt_url <- function(
82638263 target <- target %|| % " _blank"
82648264 target_values <- NULL
82658265
8266- if (grepl( " ^_ " , target )) {
8266+ if (startsWith( target , " _ " )) {
82678267 target_values <- c(" _blank" , " _self" , " _parent" , " _top" )
82688268 }
82698269
@@ -8951,7 +8951,7 @@ fmt_email <- function(
89518951 target <- target %|| % " _blank"
89528952 target_values <- NULL
89538953
8954- if (grepl( " ^_ " , target )) {
8954+ if (startsWith( target , " _ " )) {
89558955 target_values <- c(" _blank" , " _self" , " _parent" , " _top" )
89568956 }
89578957
@@ -9018,9 +9018,8 @@ fmt_email <- function(
90189018 label_separated <- unlist(strsplit(label_str , " " ))
90199019
90209020 } else if (
9021- grepl(" ^<" , label_str ) &&
9022- grepl(" >$" , label_str ) &&
9023- ! grepl(" ^<svg" , label_str )
9021+ grepl(" ^<.*>$" , label_str ) &&
9022+ ! startsWith(label_str , " <svg" )
90249023 ) {
90259024
90269025 label_separated <- unlist(strsplit(label_str , " >\\ s*<" ))
0 commit comments