Wordwrap a string with ANSI escape codes
Overall
score
100%
A utility for wrapping text containing styled hyperlinks to fit within terminal column constraints.
@generates
/**
* Wraps text containing styled hyperlinks to fit within a specified column width.
* Preserves ANSI escape codes for both hyperlinks and text styling (colors, bold, etc.)
* across line breaks.
*
* @param {string} text - The text to wrap, may contain ANSI hyperlinks and style codes
* @param {number} columns - The maximum column width for wrapping
* @returns {string} The wrapped text with preserved formatting
*/
function wrapStyledLinks(text, columns) {
// IMPLEMENTATION HERE
}
module.exports = { wrapStyledLinks };Provides text wrapping with ANSI escape code preservation, including support for hyperlinks and nested styling.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-wrap-ansidocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10