Skip to content

fix: preserve hyperlink parameters across wrapped lines - #298

Open
harbinresearcher wants to merge 1 commit into
jquast:masterfrom
harbinresearcher:codex/preserve-wrapped-hyperlink-ids
Open

harbinresearcher wants to merge 1 commit into
jquast:masterfrom
harbinresearcher:codex/preserve-wrapped-hyperlink-ids

Conversation

@harbinresearcher

Copy link
Copy Markdown

Closes #297.

When wrapped output switches from one OSC 8 hyperlink to another on the same line, the second link's continuation can inherit the first link's ID and parameters. For example, two clickable labels with id=first and id=second produce a final fragment of the second label carrying id=first.

Derive continuation parameters from the active hyperlink on each line. The propagated hyperlink state already contains any generated ID, so the separate cross-line ID cache is unnecessary. Existing IDs and metadata remain with their own link; generated IDs stay stable across that link's fragments.

Add eight public wrap() regression cases covering BEL/ST terminators, existing IDs in different parameter positions, and generated IDs with/without other metadata. All eight fail against the original implementation.

Validation:

  • The complete pure-Python suite on Windows 3.12 and Linux 3.9/3.15: 1,695 passed, 49 skipped (baseline: 1,687 passed, 49 skipped).
  • All 337 text-wrapping tests pass. Independent automated review found no actionable issue; this is not human review.
  • Linux 3.15 with the C extension built and confirmed active: 1,758 passed, 11 skipped (baseline: 1,750 passed, 11 skipped).
  • Configured tox environments flake8, flake8_tests, isort_check, pydocstyle, pylint, pylint_tests, mypy, docformatter_check, docs and twine_check pass. This includes strict Sphinx and distribution metadata/README validation.
  • Installed the built ABI3 wheel into an isolated target, verified the import path and active C extension, and reran all 337 text-wrapping tests successfully.

The pure-Python runs retain skips for optional downloaded Unicode fixtures and unavailable extension comparisons. Linux 3.15 uses the project's built-in fallback benchmark fixture instead of the optional Codspeed/cffi plugin, whose pinned cffi 1.17.1 has no cp315 wheel; pytest and coverage versions remain pinned. No runtime dependencies or public APIs change.

Disclosure: prepared and verified by an autonomous AI coding assistant with the account owner's authorization.

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.

wrap() overwrites an existing OSC 8 ID after switching links

1 participant