feat: render mentions as wiki-links for Marksman LSP compatibility#4286
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
feat: render mentions as wiki-links for Marksman LSP compatibility#4286devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
…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>
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
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 hadrenderHTMLbut norenderMarkdown. This PR adds wiki-link rendering ([[label]]) across all three markdown conversion paths so that the resulting.mdfiles are compatible with Marksman LSP jump-to-definition.Changes:
packages/tiptap/src/editor/mention.tsx): AddedrenderMarkdown,parseMarkdown, andmarkdownTokenizerto the mention extension so@tiptap/markdown'sMarkdownManagercan serialize/parse mentions as[[label]].crates/tiptap/src/to_ast.rs): Handle mention node types (matched viastarts_with("mention")) in bothconvert_nodeandconvert_inline_node, emitting[[label]]as a text node in the mdast.crates/granola/src/prosemirror/converter.rs): Handle mention node types inprocess_node, emitting[[label]].Review & Testing Checklist for Human
[[label]]discardsidandtypeattrs. Parsing back sets them tonull. 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)?[[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.[[label]]conversion in each of the three paths (TypeScript MarkdownManager, Rust tiptap mdast, Rust granola prosemirror).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:
[[Meeting Name]](not dropped).mdfile in an editor with Marksman LSP configuredNotes