Skip to content

feat: render mentions as wiki-links for Marksman LSP compatibility#4286

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772125081-mention-wikilink-compat
Open

feat: render mentions as wiki-links for Marksman LSP compatibility#4286
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772125081-mention-wikilink-compat

Conversation

@devin-ai-integration
Copy link
Contributor

feat: render mentions as wiki-links for Marksman LSP compatibility

Summary

Mentions in tiptap (e.g. mention-@ nodes) were previously silently dropped during markdown serialization — the mention extension had renderHTML but no renderMarkdown. This PR adds wiki-link rendering ([[label]]) across all three markdown conversion paths so that the resulting .md files are compatible with Marksman LSP jump-to-definition.

Changes:

  • TypeScript (packages/tiptap/src/editor/mention.tsx): Added renderMarkdown, parseMarkdown, and markdownTokenizer to the mention extension so @tiptap/markdown's MarkdownManager can serialize/parse mentions as [[label]].
  • Rust tiptap crate (crates/tiptap/src/to_ast.rs): Handle mention node types (matched via starts_with("mention")) in both convert_node and convert_inline_node, emitting [[label]] as a text node in the mdast.
  • Rust granola crate (crates/granola/src/prosemirror/converter.rs): Handle mention node types in process_node, emitting [[label]].

Review & Testing Checklist for Human

  • Lossy roundtrip by design? Serializing to [[label]] discards id and type attrs. Parsing back sets them to null. This means editor click-to-navigate (/app/${type}/${id}) will break for mentions that went through a markdown roundtrip. Is this acceptable, or should metadata be preserved (e.g. [[label]]{id=... type=...} or a different approach)?
  • Does [[label]] actually resolve in Marksman? Marksman matches [[doc]] against document titles (h1 headings) or filenames. Verify that mention labels (e.g. session names) match the corresponding note file titles so jump-to-definition works end-to-end.
  • No tests added for new behavior. Consider adding tests for mention → [[label]] conversion in each of the three paths (TypeScript MarkdownManager, Rust tiptap mdast, Rust granola prosemirror).
  • Broad pattern match: Rust uses starts_with("mention") which could match unintended future node types. Verify this is safe given the current and planned node type naming conventions.

Suggested test plan: Create a tiptap document with mention nodes, serialize to markdown, and verify:

  1. Output contains [[Meeting Name]] (not dropped)
  2. Open the .md file in an editor with Marksman LSP configured
  3. Verify jump-to-definition navigates to the correct target document

Notes

…atibility

- Add renderMarkdown/parseMarkdown/markdownTokenizer to mention extension
- Handle mention nodes in Rust tiptap mdast converter (to_ast.rs)
- Handle mention nodes in Rust granola prosemirror converter

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@netlify
Copy link

netlify bot commented Feb 26, 2026

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 8b7f8ed
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69a07cae94693e0007fd7aed
😎 Deploy Preview https://deploy-preview-4286--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Feb 26, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 8b7f8ed
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69a07cae8cacc9000837436b
😎 Deploy Preview https://deploy-preview-4286--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant