Skip to content

export/read drops table cell background colors #109

Description

@willkg

internal/convert/tables.go implements a <!-- bg:COLOR --> marker on markdown table cells that publishes as data-highlight-colour on the storage <td>/<th> (write direction, mdfluence -> Confluence). There is no inverse: internal/convert/storage_to_md.go's cellTexts (used by both read and export) never looks at data-highlight-colour and never re-emits a bg: marker, so a cell's background color is silently dropped on the way back to markdown.

Verified live against https://mozilla-hub.atlassian.net/wiki/spaces/MIR/pages/1891074056/Incident+reports (version 44): the page's storage body has 60 data-highlight-colour attributes, but markfluence export on the same page produces a file with zero bg: markers.

This also means the round trip is not just lossy for a human editing the exported file — publishing that exported file back unedited would strip every cell's background color from the live page, which is a direct violation of L5 (roundtrip-from-confluence) beyond the multi-page-export gap docs/guarantees.md already tracks it as Partial for.

Fix: cellTexts/renderTable in storage_to_md.go should read a cell's data-highlight-colour and prepend a <!-- bg:NAME --> marker (reusing cellBGSwatches's hex, reversed, falling back to the literal #rrggbb for a color outside the 21-swatch vocabulary) the same way the write path resolves a marker into that attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions