Skip to main content

apply_style_actions

Function apply_style_actions 

Source
pub fn apply_style_actions(content: &str, actions: &[StyleAction]) -> String
Expand description

Apply a sequence of style actions to content, wrapping it in ANSI escape codes.

If the content or actions are empty, the content is returned unchanged. Otherwise, the content is wrapped with the appropriate ANSI codes and a reset sequence.

§Arguments

  • content: The text to style.
  • actions: The styling actions to apply.

§Returns

The styled content with ANSI escape codes, or the original content if no styling is needed.