Skip to content

fix: escape pipe and backslash in Jira/Confluence tables (#17)#45

Merged
cmeans merged 2 commits into
mainfrom
fix/jira-pipe-escaping
Apr 12, 2026
Merged

fix: escape pipe and backslash in Jira/Confluence tables (#17)#45
cmeans merged 2 commits into
mainfrom
fix/jira-pipe-escaping

Conversation

@cmeans-claude-dev
Copy link
Copy Markdown
Contributor

Summary

  • Add _escape_jira_cell() helper that escapes \ to \\ then | to \|
  • Apply escaping in _format_jira() to all cells (header and data rows)
  • Confluence routes through _format_jira, so it gets the fix automatically
  • Add 6 tests covering pipe in data/header, double-pipe, backslash, leading/trailing pipe, and Confluence equivalence

Part of the escaping series (#16, #18).

Test plan

  • uv run pytest tests/test_parser.py -v passes all 67 tests (6 new + 61 existing)
  • Verify a cell containing | produces \| in jira output
  • Verify || in a data cell does not create accidental header markup

Closes #17

@github-actions github-actions Bot added Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA Ready for QA Dev work complete — QA can begin review and removed Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA labels Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cmeans cmeans added QA Active QA is actively reviewing; Dev should not push changes and removed Ready for QA Dev work complete — QA can begin review labels Apr 12, 2026
Copy link
Copy Markdown
Owner

@cmeans cmeans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Review — PR #45

Verdict: Zero findings. Ready for maintainer signoff.

Code review

_escape_jira_cell() (parser.py:428): Same escape order as the markdown helper — backslash first, then pipe. Correct. ✓

Header and data rows: Both header (|| delimited) and data (| delimited) rows use escaped values. The escaped array replaces normalized throughout. ✓

Confluence routing: format_table() dispatches confluence to _format_jira() (test_format_confluence_same_as_jira confirms). ✓

Double-pipe safety: A cell containing || becomes \|\|, which Jira renders as literal || in a data cell rather than interpreting it as header-row syntax. Confirmed by test_format_jira_escapes_double_pipe. This is the key Jira-specific edge case. ✓

Tests

Full suite: 232 passed, 0 failed, 0 deselected (226 base + 6 new).
Parser tests: 67 passed (61 existing + 6 new).

New tests (all PASS):

  1. test_format_jira_escapes_pipe_in_data — pipe in data cell, structural check
  2. test_format_jira_escapes_pipe_in_header — pipe in header cell
  3. test_format_jira_escapes_double_pipe|| doesn't create accidental header markup
  4. test_format_jira_escapes_backslash — lone backslash escaped
  5. test_format_jira_leading_trailing_pipe — edge case: leading/trailing pipes
  6. test_format_confluence_escapes_same_as_jira — Confluence equivalence confirmed

Manual verification

||Cmd||Desc||
|cat \| grep|filter|

Pipe in data cell correctly escaped. || in data cell: |a\|\|b|c| — no accidental header promotion. ✓

Other checks

  • CHANGELOG: ### Fixed entry under [Unreleased]. Correct category, accurate description, Closes #17. ✓
  • CI: test (3.11/3.12/3.13), codecov/patch all SUCCESS. QA Gate pending. ✓

Merge coordination note (not a finding)

This PR should merge after #44 (which carries the design spec for the series). After #44 merges, rebase this PR and move its ### Fixed CHANGELOG entry into the existing ### Fixed section (currently it's in a separate position and will create a duplicate section if auto-merged). Adding merge-order: 2 label.

Findings

None.

@cmeans
Copy link
Copy Markdown
Owner

cmeans commented Apr 12, 2026

Applying Ready for QA Signoff. 232/232 tests pass (6 new), manual verification confirms correct escaping and double-pipe safety. Zero findings. Merge AFTER #44, then rebase to consolidate the CHANGELOG Fixed section.

@cmeans cmeans added Ready for QA Signoff QA passed — ready for maintainer final review and merge merge-order: 2 Merge second — depends on merge-order: 1 and removed QA Active QA is actively reviewing; Dev should not push changes labels Apr 12, 2026
cmeans-claude-dev[bot] and others added 2 commits April 11, 2026 23:40
Cells containing | or \ now produce valid Jira wiki markup.
Prevents || in data cells from being misinterpreted as header syntax.

Closes #17

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Strengthen double-pipe assertion to check exact escaped form
- Add CHANGELOG entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cmeans cmeans force-pushed the fix/jira-pipe-escaping branch from 87f416f to 3a8a52a Compare April 12, 2026 04:40
@cmeans cmeans added QA Approved Manual QA testing completed and passed and removed Ready for QA Signoff QA passed — ready for maintainer final review and merge labels Apr 12, 2026
Copy link
Copy Markdown
Owner

@cmeans cmeans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cmeans cmeans merged commit c9b87c0 into main Apr 12, 2026
9 checks passed
@cmeans cmeans deleted the fix/jira-pipe-escaping branch April 12, 2026 04:42
@github-actions github-actions Bot added the Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA label Apr 12, 2026
cmeans-claude-dev Bot added a commit that referenced this pull request Apr 12, 2026
## Summary

- New `tests/test_escaping.py` with parametrized test matrix
- Covers 20 special character variants across all 8 output formats (160
structure tests + 40 round-trip tests)
- HTML `<>&"` tests xfail pending #15
- Slack `*` and backtick tests xfail pending #19
- Newline-in-cell tests xfail for line-based formats (no escape exists)
- Moves #18 CHANGELOG entry to Added section (tests are additions)

Depends on #44 and #45 being merged first (branch includes both).

## Test plan

- [ ] `uv run pytest tests/test_escaping.py -v` shows 189 passed, 0
skipped, 11 xfailed
- [ ] `uv run pytest -q` full suite passes with 0 skipped

Closes #18

---------

Co-authored-by: cmeans-claude-dev[bot] <3223881+cmeans-claude-dev[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA merge-order: 2 Merge second — depends on merge-order: 1 QA Approved Manual QA testing completed and passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira/Confluence table format does not escape pipe characters

1 participant