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

Foam doesn't support the title attribute in images links #1262

Open
junfx opened this issue Jul 21, 2023 · 7 comments
Open

Foam doesn't support the title attribute in images links #1262

junfx opened this issue Jul 21, 2023 · 7 comments
Labels
bug Something isn't working foam-core Related to API, core model or feature
Milestone

Comments

@junfx
Copy link

junfx commented Jul 21, 2023

Describe the bug

I have the same issue, like #1200, with different cause. foam v0.24.0

![](/attachments/2021/2021-03-26-19-01-16.png)      show as a placeholder
![](a/b/c.jpg)                                      no such image, show as a placeholder
![](../../a/b/c.jpg)                                no such image, show as a placeholder
![](/attachments/foam-icon.png)                     show as a placeholder
![](../../attachments/2021/2021-03-26-19-01-16.png)   ok
![](../../attachments/foam-icon.png)                  ok

I guess we cannot use absolute style path for images.

My pasteImage settings:

  "pasteImage.path": "${projectRoot}/attachments/2023",
  "pasteImage.insertPattern": "${imageSyntaxPrefix}/${imageFilePath}${imageSyntaxSuffix}",
  "pasteImage.basePath": "${projectRoot}",

And it looks like treating non-markdown files as placeholders:

[](../../archive/cards/cant-allocate-memory.md)    ok
[](../.emacs)                                      file exists; show as a placeholder
[](../../.vscode/extensions.json)                  file exists; show as a placeholder

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

search show as a placeholder in issue's description.

Expected behavior

  1. if links an existed image/file, the "PLACEHOLDERS" session will not show them
  2. support abs path relative to project root?

Screenshots or Videos

image

Operating System Version

Windows 10

Visual Studio Code Version

1.74 and 1.80

Additional context

No response

@riccardoferretti
Copy link
Collaborator

There are two issues here IMO:

  1. attachments needs to be explicitly added to Foam via the setting. At this point I believe this was the wrong call, and that attachments should all be included by default, giving people the option of excluding them as needed (e.g. via the foam.files.ignore setting)
  2. we don't support absolute links from the repo root. the convention we have so far is:
  • if the path starts with / it's considered to be absolute (at the system level, e.g. /Users/riccardo/hello.md)
  • if the path starts with ./ or ../ it's considered to be relative to the current file/context
  • if the path starts with anything else it's considered to be relative to the workspace root (e.g. journal/today.md)

Let's keep this task for n.2 and absolute/relatives paths.
Feel free to create a new issue for n.1

@riccardoferretti riccardoferretti added this to the backlog milestone Jul 21, 2023
@riccardoferretti riccardoferretti added the foam-core Related to API, core model or feature label Jul 21, 2023
@BoudSTER
Copy link

Hi,

I have the same issue and I didn't understand your answer.

Screenshot 2023-07-26 at 08 06 45 Screenshot 2023-07-26 at 08 08 28

Thank you in advance for your reply :)

BoudSTER

@riccardoferretti
Copy link
Collaborator

Sorry, not sure I understand your question from the screenshot you provided, can you clarify?

As context, I should also mention that wikilinks embeds for images work, e.g. ![[my-image.png]]

@wdssmq
Copy link

wdssmq commented Aug 10, 2023

It seems that foam did not consider the possibility of the Title attribute appearing.

pic

@riccardoferretti
Copy link
Collaborator

Yup, good point, that's exactly the issue

@riccardoferretti riccardoferretti added the bug Something isn't working label Aug 12, 2023
@riccardoferretti riccardoferretti changed the title Shows existed file/image as a placeholder Foam doesn't support the title attribute in images links Sep 22, 2023
@meteorlin
Copy link

meteorlin commented Mar 18, 2024

Is there any progress on this issue?
In addition, I also found that Foam treats the node's parent directory as a node that has not been created after executing Foam: show graph.
image

It seems that Foam treats existed asset as node as well, even if the asset isn't linked in any markdown file (such as "nanoGPT.pptx" shown below).
image

@riccardoferretti
Copy link
Collaborator

No progress on this so far, it's not been super high on my list and nobody has taken it on.

Please file a separate bug report for anything else so it's easier to keep track of things, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working foam-core Related to API, core model or feature
Projects
None yet
Development

No branches or pull requests

5 participants