Overhaul Link parsing

We were mixing up header links with wiki links and the alt text. It was
a bit messy. We currently do not support linking to a particular part of
a note. Nor do we support wiki links as link references.

Fixes APP-A0
This commit is contained in:
Vishesh Handa
2020-09-14 12:20:15 +02:00
parent a58c27ed1c
commit c94ff85804
8 changed files with 181 additions and 50 deletions

View File

@ -173,7 +173,11 @@ class NoteSnippet extends StatelessWidget {
var body = note.body.split('\n');
var paragraph = body.firstWhere(
(line) => line.contains('[${link.term}]'),
(String line) {
return link.isWikiLink
? line.contains('[[${link.wikiTerm}}]]')
: line.contains('[${link.publicTerm}]');
},
orElse: () => "",
);