markdown.renderer.table_layout — Lilush API

←index

← markdown.renderer

Overview

Table layout utilities for markdown renderers. Handles column width fitting, text wrapping with UTF-8 span tracking, cell padding computation, and overflow normalization.

Functions

NameSignature
wrap_text_with_spanswrap_text_with_spans(text, width) -> lines
fit_table_widthfit_table_width(col_widths, available_width) -> col_widths
compute_paddingcompute_padding(align, width, content_width) -> left_pad, right_pad
normalize_overflownormalize_overflow(mode) -> mode

wrap_text_with_spans(text, width) -> lines

Wrap text to width while tracking source UTF-8 character spans

fit_table_width(col_widths, available_width) -> col_widths

Fit table column widths to available width by shrinking widest columns

compute_padding(align, width, content_width) -> left_pad, right_pad

Compute left and right padding for aligned cell content

normalize_overflow(mode) -> mode

Normalize overflow mode to "wrap" or "clip"