Skip to content

[Bug] Markdown nested list indentation is stripped on update_object write #84

Description

@FeernandoOFF

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

Leading spaces before nested - [ ] items are stripped. The list is flattened:

## Tasks
- [ ] Parent task A
- [ ] Subtask A1
- [ ] Subtask A2
- [ ] Parent task B
- [ ] Subtask B1
- [ ] Subtask B2
  - [ ] Deep subtask B2a   ← only survived because it uses U+2007 figure spaces
- [ ] Parent task C
- [ ] Subtask C1

Expected Behavior

The Tasks section should preserve its nested structure exactly as written.

Steps To Reproduce

  1. Read an object that contains nested markdown checkboxes:
## Tasks
- [ ] Parent task A
  - [ ] Subtask A1
  - [ ] Subtask A2
- [ ] Parent task B
  - [ ] Subtask B1
  - [ ] Subtask B2
    - [ ] Deep subtask B2a
- [ ] Parent task C
  - [ ] Subtask C1
  1. Update the same object via PUT /v1/spaces/{spaceId}/objects/{objectId} with the same markdown body (only changing a different section, e.g. an Evening note at the bottom).

  2. Read the object back.

  3. Leading spaces before nested - [ ] items are stripped. The list is flattened:

Environment

- Anytype Desktop: 0.47.x (latest stable)
- API version: 2025-11-08
- Client: @anyproto/anytype-mcp v1.2.9 (but reproducible directly via REST)

Anything else?

  • The get_object endpoint does return correct indentation on read (it uses figure spaces U+2007 for nesting in its output).
  • However, writing standard markdown spaces ( - [ ]) back through the API causes them to be lost during parsing.
  • This makes it impossible to do "surgical" updates to journal/daily-note objects where only the bottom section changes — the whole body must be rewritten, and that rewrite destroys the top-level Tasks hierarchy.
  • Workaround: manually using non-standard whitespace (figure spaces) before nested items, but this is not practical for users writing standard markdown.

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