Render and navigate [[wikilink]] syntax in notes
- Add WikilinkSyntax (InlineSyntax) that parses [[Note Title]] into anchor elements with a wikilink:// href - wikilinkExtensionSet extends GFM with this syntax; shared by detail view and edit preview so rendering is consistent - NoteDetailScreen handles onTapLink: wikilink:// hrefs look up the target note by title (case-insensitive) and push its detail route; unresolved links show a "Note not found" snackbar - Add markdown as an explicit dependency (was previously transitive) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../core/exceptions.dart';
|
||||
import '../../core/wikilink_syntax.dart';
|
||||
import '../../providers/api_client_provider.dart';
|
||||
import '../../providers/notes_provider.dart';
|
||||
|
||||
@@ -149,7 +150,10 @@ class _NoteEditScreenState extends ConsumerState<NoteEditScreen> {
|
||||
const Divider(),
|
||||
Expanded(
|
||||
child: _preview
|
||||
? Markdown(data: _contentController.text)
|
||||
? Markdown(
|
||||
data: _contentController.text,
|
||||
extensionSet: wikilinkExtensionSet,
|
||||
)
|
||||
: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16),
|
||||
|
||||
Reference in New Issue
Block a user