javalent / admonitions

Adds admonition block-styled content to Obsidian.md
MIT License
1.08k stars 72 forks source link

Unresolved internal links don't look different #328

Closed davidkopp closed 8 months ago

davidkopp commented 8 months ago

Check for existing bug reports before submitting.

Expected Behavior

Internal links that are not resolvable, e.g. the linked note does not exist yet, should look differently in comparison to internal links that are resolvable. In a normal text and within an Obsidian callout this is the case, but not within an admonition.

Current behaviour

Comparison Callout vs. Admonition:

image

Reproduction

Used markdown:

> [!info] Callout
> 
> [[note does exist]]
> [[note does not exist yet]]

```ad-info
title: Admonition

[[note does exist]]
[[note does not exist yet]] 
```

The note with the name "note does exist" was created for this test.

Which Operating Systems are you using?

Obsidian Version Check

1.5.3

Plugin Version

10.1.1

Confirmation

Possible solution

When I add the class is-unresolved to the link in the admonition with the help of the developer console the link does get formatted correctly.

Potential fix: Add a check if the internal links inside an admonition are resolvable before the admonition gets rendered. If not, add the class is-unresolved to it.

valentine195 commented 8 months ago

This is unfortunately an issue from Obsidian. Admonitions does not do anything special with links, it just provides the content to Obsidian's markdown renderer and displays what it is given. It looks like the renderer in live preview is not setting the links to unresolved (oddly enough it looks like it does in reading mode).

I'll talk to the Obsidian devs to see what's going on, but I'm going to close this issue.