diff --git a/main.js b/main.js index eb79ddf..ec12dff 100644 --- a/main.js +++ b/main.js @@ -275,6 +275,10 @@ var commands = [ hint: "Sort text", action: sortselection, allowunsaved: true +}, +{ + hint: "Show backlinks", + action: backlinks }]; var snippets = [ @@ -1564,6 +1568,14 @@ function getlinesrange() }; } +function backlinks() +{ + searchinlist(localdata + .filter(n => n.content.includes("[[" + currentnote.title + "]]")) + .map(n => n.title)) + .then(loadnote); +} + function sortselection() { var content = md.value;