Skip to main content

wrap

Function wrap 

Source
pub fn wrap(text: &str, width: usize) -> String
Expand description

Wrap text at word boundaries, respecting tag values.

Tag values like @tag(value with spaces) are treated as single units and will not be broken across lines. Width is measured by visible characters (ANSI escapes are excluded from the count).

Returns the original text unchanged if width is 0.