In a medialink, if it has a display text identical to the filename (without the .md), and the linked note has an icon, the icon is rendered twice.
This scenario is relevant when the link has a path component that you don't wish to show.
The issue is observed both when the icon has been changed directly in the frontmatter with the icon property, and also when using the "Change Icon" menu item.
To Reproduce
In the file, journals/2024-07-07.md, I added an icon in the frontmatter (the first day I tried out iconize):
Today, in the file, journals/2024-07-08.md, I have the following markdown
- Yesterday: [[journals/2024-07-07|2024-07-07]]
The calendar icon is rendered twice in that link:
Placing the cursor on the link, it's apparent that it's probably the link text is the source of the extra icon render.
Additional note
If I change the link text, e.g. the link becomes: [[journals/2024-07-07|x2024-07-07]], the double icon disappears. If I change it back to what it was, the double icon reappears.
Expected behavior
The icon should only be rendered once ;)
Additional context
I did not try this in a minimal sandbox vault, but I did try using a few different themes, just to eliminate it wasn't a theme issue. The issue exists in all the themes I tried (Default, Things, Typomagical, Molecule).
If the bug is not immediately reproducible, I'll gladly make a minimal vault that shows the issue.
p.s. I haven't looked at your code yet, but I've been doing plugins recently relying heavily on metadata, and also detecting content in the page. So I wouldn't mind giving it a look, and see if I can identify the issue if you want input.
Describe the bug
In a medialink, if it has a display text identical to the filename (without the .md), and the linked note has an icon, the icon is rendered twice.
This scenario is relevant when the link has a path component that you don't wish to show.
The issue is observed both when the icon has been changed directly in the frontmatter with the
icon
property, and also when using the "Change Icon" menu item.To Reproduce
In the file,
journals/2024-07-07.md
, I added an icon in the frontmatter (the first day I tried out iconize):Today, in the file,
journals/2024-07-08.md
, I have the following markdownThe calendar icon is rendered twice in that link:
Placing the cursor on the link, it's apparent that it's probably the link text is the source of the extra icon render.
Additional note
If I change the link text, e.g. the link becomes:
[[journals/2024-07-07|x2024-07-07]]
, the double icon disappears. If I change it back to what it was, the double icon reappears.Expected behavior
The icon should only be rendered once ;)
Additional context
I did not try this in a minimal sandbox vault, but I did try using a few different themes, just to eliminate it wasn't a theme issue. The issue exists in all the themes I tried (Default, Things, Typomagical, Molecule).
If the bug is not immediately reproducible, I'll gladly make a minimal vault that shows the issue.
p.s. I haven't looked at your code yet, but I've been doing plugins recently relying heavily on metadata, and also detecting content in the page. So I wouldn't mind giving it a look, and see if I can identify the issue if you want input.