R/text-break.R

Defines functions text_break

Documented in text_break

text_break_values <- chr(
  "TRUE" = "break"
)

#' Break long text
#'
#' The `text_break()` function is used to break long strings of text within a
#' tag element.
#'
#' @param x `r param_subject()`
#'
#' @returns `r returns_same("x")`
#'
#' @family text utilities
#'
#' @export
#'
#' @examples
#'
#' library(htmltools)
#'
#' div(
#'   .style %>%
#'     text_break(),
#'   "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"
#' )
#'
text_break <- function(x) {
  add_class(
    x,
    compose_class(
      "text",
      text_break_values,
      TRUE
    )
  )
}

Try the cascadess package in your browser

Any scripts or data that you put into this service are public.

cascadess documentation built on Oct. 30, 2024, 9:29 a.m.