zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

No way to remove links once added #2066

Closed viq closed 2 years ago

viq commented 3 years ago

Trilium 0.47.5

Once links between notes are added (for example by adding ~internalLink attribute) there is no way to remove them, for example if it was done in error.

zadam commented 3 years ago

Hi, can you describe the problem in more detail? internalLink is not a relation you create manually, it gets created when you link a note from another note. You're right that it's not possible to delete it (without removing the link from text note).

viq commented 3 years ago

Skimming through the documentation it seems that the way to create links between notes is by adding attributes (which?) to them. So I tried doing that, a bit at random. I created a link between notes A->B. Then I figured that's not how I want this to be, and created a link B->A. Now there are links going both ways, and from reading documentation I don't see a way to remove either of them.

abitofevrything commented 3 years ago

Let's say that the relation you created was a ~template=<note> relation. On note A, the relation attribute would look like this: ~template=B. On note B, it would look like this: ~template=A. To remove the link from A to B, simply delete the ~template=B relation on note A.

removeRelation

zadam commented 3 years ago

@viq mentioned internalLink which is a special (hidden) relation used when you create a hyperlink between text notes. But it seems @viq created it somehow manually or wants to delete it manually. I still don't understand the situation exactly ...

abitofevrything commented 3 years ago

I have managed to reproduce the issue, here is a video file: internal-link

zadam commented 3 years ago

I see, thanks for the demo. But I think it's rather a weird unsupported corner case rather than a bug.

internalLink is not supposed to be declared manually. It's parsed automatically when editing the text note. Workaround for this particular problem is just editing the text note - links will be parsed out - link to B doesn't exist in the text content (actually never existed) so the internalLink relation will be deleted.