Skip to content

fix(convert): recover table cell background colors on export/read - #110

Merged
willkg merged 1 commit into
mainfrom
fix/export-table-cell-bg-colors
Aug 30, 2026
Merged

fix(convert): recover table cell background colors on export/read#110
willkg merged 1 commit into
mainfrom
fix/export-table-cell-bg-colors

Conversation

@willkg

@willkg willkg commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • storage_to_md.go never read data-highlight-colour, so a page's table cell background colors were silently dropped on export/read even though MdToConfluence fully supports writing them from a bg: marker.
  • Verified live against a page with 60 colored cells (MIR/1891074056): before the fix, export recovered 0 bg: markers; after, all 60 round-trip correctly, including swatch-name normalization and the gray/grey hex collision.

Fix

  • Added cellBGNames, the reverse of tables.go's swatch map (hex → name, British spelling wins where a hex has two names).
  • Added cellBGMarkerComment in storage_to_md.go, used by cellTexts to re-emit <!-- bg:NAME --> for any cell carrying data-highlight-colour (falling back to the literal hex for a color outside the 21-swatch vocabulary).
  • Updated CLAUDE.md's architecture notes to describe the reverse mapping.

Fixes #109.

Test plan

  • Added TestRoundTripTableCellBG (swatch-name recovery, hex→name normalization, gray/grey collision)
  • make check passes (vet, fmt-check, test, build, lint)
  • Re-ran export against the live page that originally exposed the bug and confirmed colors now round-trip

storage_to_md.go never read data-highlight-colour, so a page's cell
background colors were silently dropped on export/read even though
MdToConfluence fully supports writing them from a bg: marker. Verified
live against MIR/1891074056 (60 colored cells, 0 recovered).

Fixes #109.
@willkg
willkg merged commit dd2d333 into main Aug 30, 2026
1 check passed
@willkg
willkg deleted the fix/export-table-cell-bg-colors branch August 30, 2026 11:35
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.

export/read drops table cell background colors

1 participant