markdown.renderer.utils.wrap_content

markdown.renderer.utils

wrap_content(content, width) -> lines

Wrap content with inline ranges to fit a display width

Word-wraps content.plain at width display columns, splitting content.ranges across the resulting lines. Returns an array of content tables {plain, ranges} — one per wrapped line — with range positions adjusted to each line's local coordinate system. Returns the original content in a single-element array when no wrapping is needed.