Ajustar líneas de texto
text-wrapAjusta texto a un ancho máximo de línea respetando saltos existentes. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: acortar un texto a una longitud máxima (text-truncate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Wraps text to a maximum line width (in graphemes) at spaces, keeping existing line breaks; words longer than the width are split only if break_long_words is true. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: shortening text to a maximum length (text-truncate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Input text (string; required). | |
| width | No | Line width (integer; optional; default 80; min 1; max 1000). | |
| break_long_words | No | Split words longer than width (boolean; optional; default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No |