anyproto / anyproto/anytype-api

Table cell content loses newlines in markdown serialisation

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
113
Forks
20
Avg merge
16m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing GET /v1/spaces/{space_id}/objects/{object_id}?format=md with a table containing multiple text blocks per cell, then compare its output with plain text blocks outside tables. Trace the GET and PATCH object behavior; done means a format=blocks response exposes raw block structure so table content can be read and written without lossy markdown serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.