feat: proper wiki-links as custom BlockNote inline content with suggestion menu

- Custom 'wikilink' inline content type via createReactInlineContentSpec
- Extended BlockNote schema with wikilink spec
- Suggestion menu triggered by [[ showing all vault entries
- Markdown round-trip: [[target]] → placeholder tokens → wikilink inline content
- Click handler on .wikilink elements for navigation
- Removed old hack (regex preprocessing to wikilink.internal URLs + DOM click interception on <a> tags)
- Added .wikilink CSS styles
- Passed entries prop from App.tsx to Editor for suggestion menu
This commit is contained in:
lucaronin
2026-02-15 19:50:23 +01:00
parent 4284ed3221
commit 9a9769334e
3 changed files with 154 additions and 38 deletions

View File

@@ -107,6 +107,22 @@
color: var(--text-primary);
}
/* Wikilink inline content */
.wikilink {
color: var(--accent-blue, #2196f3);
cursor: pointer;
text-decoration: underline;
text-decoration-style: dotted;
text-underline-offset: 2px;
border-radius: 2px;
padding: 0 1px;
}
.wikilink:hover {
background: var(--accent-blue-bg, rgba(33, 150, 243, 0.1));
text-decoration-style: solid;
}
/* BlockNote container */
.editor__blocknote-container {
flex: 1;