Skip to content

fix(client): skip structural whitespace in annotations#5

Merged
auspham merged 1 commit into
mainfrom
austinpham/comment-anchor-mark
Jul 14, 2026
Merged

fix(client): skip structural whitespace in annotations#5
auspham merged 1 commit into
mainfrom
austinpham/comment-anchor-mark

Conversation

@auspham

@auspham auspham commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Prevent persistent text annotations from wrapping whitespace-only slices when a selection crosses nested elements. Those synthetic <mark> nodes became real grid or flex children in artifact layouts, producing large empty elements beside the selected content.

Add a browser regression that anchors a full card inside a CSS grid and verifies the selected text remains marked without adding whitespace marks or synthetic grid children.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor or tooling
  • Other:

How was this tested?

The browser regression failed before the fix with five whitespace-only marks, then passed after wrapRange skipped whitespace-only text slices.

  • python -m pytest tests/python
  • ruff check skills/htmlit tests/python
  • npm test (browser client)

Checklist

  • I added or updated tests for this change (a bug fix has a test that fails before the fix).
  • I did not add any runtime dependency to the skill (standard library only).
  • I did not commit vendored assets (Mermaid, highlight.js, Idiomorph).
  • Commits follow Conventional Commits and are signed off (git commit -s).

Copilot-Session: 7a66568e-3c1d-4cc8-8f79-acfc0b6c3f91
Signed-off-by: Austin (Ngoc Thang) Pham <austinpham@microsoft.com>
@auspham auspham merged commit be64672 into main Jul 14, 2026
4 checks passed
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