feat: convert anytype:// URLs to Mention marks in markdown parser - #2979
Open
axcornea wants to merge 1 commit into
Open
feat: convert anytype:// URLs to Mention marks in markdown parser#2979axcornea wants to merge 1 commit into
axcornea wants to merge 1 commit into
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Open
3 tasks
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
force-pushed
the
fix/anytype-mention-links
branch
from
February 28, 2026 21:57
f9ab77c to
efdb7d5
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
|
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 :/ |
|
Want to bump this as an important feature for API updates to Anytype-based documentation |
|
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. |
This was referenced Jul 8, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
anytype://object?objectId=...URLs: they now produce tracked Mention marks (type=8) instead of plain Link marks (type=5)links/backlinksproperties are now correctly populated when content is created via the REST API or paste path@-mentions (with underline and type-specific icons like task checkboxes)Problem
The markdown parser (
renderer.go) treated all URLs uniformly, includinganytype://URLs, creating Link marks (type=5). Only Mention marks (type=8) are trackedin the object graph (
smartblock.go), so content created via the API/MCP had emptylinks/backlinksdespite containing valid object references.This broke the markdown round-trip: Anytype exports
@-mentions asanytype://object?objectId=...URLs, but importing the same markdown back produced untrackedhyperlinks instead of mentions.
Fix
Single change in
renderer.go: detectanytype://object?objectId=...URLs at parse time and emit Mention marks with the extractedobjectIdas the param, insteadof Link marks with the full URL.
Fixes anyproto/anytype-mcp#31
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?