Skip to content

feat: convert anytype:// URLs to Mention marks in markdown parser - #2979

Open
axcornea wants to merge 1 commit into
anyproto:developfrom
axcornea:fix/anytype-mention-links
Open

feat: convert anytype:// URLs to Mention marks in markdown parser#2979
axcornea wants to merge 1 commit into
anyproto:developfrom
axcornea:fix/anytype-mention-links

Conversation

@axcornea

@axcornea axcornea commented Feb 28, 2026

Copy link
Copy Markdown

Summary

  • Fixes the markdown round-trip for anytype://object?objectId=... URLs: they now produce tracked Mention marks (type=8) instead of plain Link marks (type=5)
  • links/backlinks properties are now correctly populated when content is created via the REST API or paste path
  • Inline mentions render identically to UI-created @-mentions (with underline and type-specific icons like task checkboxes)

Problem

The markdown parser (renderer.go) treated all URLs uniformly, including anytype:// URLs, creating Link marks (type=5). Only Mention marks (type=8) are tracked
in the object graph (smartblock.go), so content created via the API/MCP had empty links/backlinks despite containing valid object references.

This broke the markdown round-trip: Anytype exports @-mentions as anytype://object?objectId=... URLs, but importing the same markdown back produced untracked
hyperlinks instead of mentions.

Fix

Single change in renderer.go: detect anytype://object?objectId=... URLs at parse time and emit Mention marks with the extracted objectId as the param, instead
of Link marks with the full URL.

Fixes anyproto/anytype-mcp#31


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

@github-actions

github-actions Bot commented Feb 28, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

The markdown parser (renderer.go) created plain Link marks (type=5) for
all URLs including anytype://object?objectId=... links. Only Mention
marks (type=8) are tracked in the object graph, so links/backlinks
properties stayed empty when content was created via the API/paste path.

This detects anytype://object?objectId=... URLs at parse time and emits
Mention marks instead of Link marks, fixing the markdown round-trip:
Anytype exports @-mentions as anytype:// URLs, and now imports them back
as tracked mentions.

Fixes anyproto/anytype-mcp#31

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@axcornea
axcornea force-pushed the fix/anytype-mention-links branch from f9ab77c to efdb7d5 Compare February 28, 2026 21:57
@axcornea axcornea changed the title feat: convert anytype:// URLs to Mention marks in API/paste path feat: convert anytype:// URLs to Mention marks in markdown parser Feb 28, 2026
@axcornea

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@crazysoldier

Copy link
Copy Markdown

Can my bot make proper links to other objects with this? I am building a Peoples and Projects database and want to link the team members for every company but i can only do it manually in the UI :/

@jchristman

Copy link
Copy Markdown

Want to bump this as an important feature for API updates to Anytype-based documentation

@IronTopi

Copy link
Copy Markdown

want to bump this as well, this fix would allow for proper api/mcp interaction and thus open the door to a lot of great use cases.

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.

Cannot create rich mentions via MCP that e.g. render a task with a checkbox

4 participants