Skip to content

Table cell content loses newlines in markdown serialisation #48

@romanr

Description

@romanr

Have you read a contributing guide?

  • I have read CONTRIBUTING.md
  • I have searched the existing issues and didn't find any that were similar
  • I have considered creating a pull request with fixes instead of a bug report and want to proceed

Current Behavior

Related to #33 - this is a specific bug that demonstrates why markdown-only is insufficient, not just a feature gap.
GET /spaces/{space_id}/objects/{object_id}?format=md serialises table cells by joining all text blocks with spaces, stripping newlines. A cell containing:

Line one
Line two
Line three

Is returned as:

Line one Line two Line three

When that markdown is written back via PATCH object, every cell in the entire table - including untouched columns - collapses into a single unformatted block. The page is permanently damaged until restored from backup.

Plain text blocks outside a table in the same object serialise correctly with \n between them. The bug is specific to table cell serialisation.

Expected Behavior

Expose a format=blocks option on GET object to return the raw block structure, allowing consumers to read and write at the block level without going through the lossy markdown layer.

Steps To Reproduce

  1. Create a page with a table where cells contain multiple lines (multiple text blocks per cell)
  2. Call GET /v1/spaces/{space_id}/objects/{object_id}?format=md
  3. Observe newlines are stripped inside table cells but preserved in plain text blocks outside the table
  4. Take the returned markdown, modify any part of it (e.g. fill an empty column), send back via PATCH /v1/spaces/{space_id}/objects/{object_id}
  5. Open the page in Anytype - all table cells are now single unformatted blocks

Environment

- OS:macos 26
- Version:0.54.2

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions