Skip to content

fix: prevent padding of multi-pipe connector lines#6

Merged
kmelve merged 1 commit intomainfrom
fix/connector-line-padding
Feb 3, 2026
Merged

fix: prevent padding of multi-pipe connector lines#6
kmelve merged 1 commit intomainfrom
fix/connector-line-padding

Conversation

@kmelve
Copy link
Contributor

@kmelve kmelve commented Feb 3, 2026

Summary

  • Fix bug where multi-pipe connector lines between side-by-side boxes were incorrectly padded
  • Add isConnectorLine() function to detect connector lines (3+ pipes with only whitespace between)
  • Modify isContentLine() to exclude connector lines from processing

Problem

Lines like │ │ │ that form visual connectors between adjacent boxes were classified as "content lines" and padded, breaking diagrams:

-                    │                 │                 │
+                    │                 │                       │

Real-world bug from soderlind/admin-coach-tours@4c0d1de

Solution

The new heuristic distinguishes:

  • │ │ │ (connector - 3 pipes, whitespace between) → NOT a content line
  • │ foo │ bar │ (table row - 3 pipes with text) → remains a content line
  • │ content │ (normal content - 2 pipes) → remains a content line

Test plan

  • Run pnpm test:run - all 66 tests pass
  • Run pnpm build - build succeeds
  • Verify connector lines are not modified
  • Verify normal content lines are still padded correctly

🤖 Generated with Claude Code

Lines with multiple │ characters that form connectors between
side-by-side boxes were incorrectly classified as content lines
and padded, breaking diagrams like:

    │             │             │

Add isConnectorLine() function to detect lines with more than 2
vertical bars where all segments between them are whitespace-only.
Modify isContentLine() to exclude these connector lines.

Fixes issue reported in soderlind/admin-coach-tours@4c0d1de

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kmelve kmelve merged commit 3ac05aa into main Feb 3, 2026
2 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