Skip to content

Support wrapping inline-only list items - #297

Open
xiangnuans wants to merge 1 commit into
matthewwithanm:developfrom
xiangnuans:codex/wrap-inline-list-items
Open

xiangnuans wants to merge 1 commit into
matthewwithanm:developfrom
xiangnuans:codex/wrap-inline-list-items

Conversation

@xiangnuans

Copy link
Copy Markdown

Refs #78.

With wrap=True, a plain <li> currently stays on one line while the same content inside <li><p>…</p></li> wraps. This applies the existing paragraph wrapping logic to inline-only list items, keeping the current continuation indentation for ordered and unordered lists. wrap_width remains the content width, before list markers and indentation.

Items containing block descendants retain their existing layout; inline-only leaves of nested lists can wrap. This is a limited improvement for #78, not full reflow of mixed block/inline list content. The default wrap=False behavior is unchanged.

Validation: the three new regression tests fail against the unchanged baseline and pass with the fix. tox -e py312 passes all 86 tests, flake8, and README RST lint. Tests cover ordered/unordered indentation, inline emphasis, both hard-break styles, nested lists, block-layout preservation, and wrap_width=None.

AI disclosure: OpenAI Codex assisted with investigation, implementation, tests, and this description; a separate AI-assisted review checked the changes. All reported checks were run locally. No human review is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant