Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wikilink markdown link generation deletes/recreates each time the file is saved #1339

Open
sdeiley opened this issue Feb 26, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@sdeiley
Copy link

sdeiley commented Feb 26, 2024

Describe the bug

Succinct Description:

When I save a file, with or without changes, Foam either removes existing markdown links for that notes wikilinks, or it generates them if they aren't there.

Exact Observed Behavior

Consider a simple markdown file with the following:

## Title
[[root.AnotherNote.md]]

Now I save the file. I see

## Title
[[root.AnotherNote.md]]


[//begin]: # "Autogenerated link references for markdown compatibility"
[root.AnotherNote.md] root.AnotherNote "Another Note"
[//end]: # "Autogenerated link references"

However, if I save again, I see (notice additional newlines at bottom):

## Title
[[root.AnotherNote.md]]



Additional Notes

  • there is a clickable message saying "Wikilink definitions (out of date)" which, when clicked, deletes the markdown links.
  • Foam: Run Janitor (experimental) also does the exact thing (add or remove markdown links) to all files in the directory.

Settings

My only explicit foam setting is:

{
...
  "foam.edit.linkReferenceDefinitions": "withoutExtensions",
}

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

  1. Fresh install of foam version 0.25.8 (note: I have other markdown extensions, I am not sure if they are the problem).
  2. Change foam setting "foam.edit.linkReferenceDefinitions": "withoutExtensions"
  3. Create two notes. Wikilink one from the other.
  4. CNTL+SHIFT+P File: Save
  5. Observe changes to file
  6. Repeate Steps 4/5

Expected behavior

I didn't expect the links to be deleted by saving or Foam: Run Janitor. I also don't expect the little description "Wikilinks out of date" to be there.

Screenshots or Videos

Screenshot 2024-02-26 at 1 33 48 PM

Operating System Version

macOS

Visual Studio Code Version

Version: 1.86.1 (Universal) Commit: 31c37ee8f63491495ac49e43b8544550

Additional context

No response

@riccardoferretti riccardoferretti added the bug Something isn't working label Feb 29, 2024
@riccardoferretti riccardoferretti added this to the backlog milestone Feb 29, 2024
@riccardoferretti
Copy link
Collaborator

I cannot reproduce this from the given steps, can you please provide a repo to use as base where the issue can be reproduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants