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

Text editor link highlights are the same color for existant and non-existant links #30

Open
tekwizz123 opened this issue May 9, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request obsidian upstream Issue related to upstream obsidian functionality

Comments

@tekwizz123
Copy link

tekwizz123 commented May 9, 2021

Title pretty much says it all. In the preview pane, the color for existent and non-existent links are different, as non-existent links show up in a faded grey, whilst existing links have a blue underline if an internal link, or purple underline if external. Yet in editor mode, the same link shows with a blue underline regardless of if the linked note exists or not.

@bennyxguo bennyxguo added the enhancement New feature or request label May 9, 2021
@bennyxguo bennyxguo self-assigned this May 9, 2021
@bennyxguo
Copy link
Owner

Ok, I will work on it this week. :)

@krokofant
Copy link
Collaborator

It seems that Obsidian itself does not differentiate between existing and non-existing links in editing mode. So the editing mode can't be fixed here.
image

image

Unfortunately this problem also exists for the live preview mode, and it's actually a little worse there.
image

@bennyxguo
Copy link
Owner

@krokofant I got this one fixed by applying the underline style to the cm-underline class inside the cm-link. Thanks for keeping me updated on these issues and doing the contributions! 👍🏻

@krokofant
Copy link
Collaborator

krokofant commented Oct 9, 2022

@bennyxguo That's great! You fixed the live preview issue (which was reported separately), but this issue I assume still exists.
That existing and non-existing link references all look the same in edit mode & live preview mode. As far as I can tell Obsidian only exposes classes for targeting existing links in read mode (.internal-link.is-unresolved).

Edit mode:
image

<div class="cm-line"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><span class="cm-link"><span class="cm-underline">This exists</span></span><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"></div>
<div class="cm-line"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><span class="cm-link"><span class="cm-underline">This doesn't exist</span></span><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"><img class="cm-widgetBuffer" aria-hidden="true"><span contenteditable="false"></span><img class="cm-widgetBuffer" aria-hidden="true"></div>

Read mode:
image

<a class="internal-link" data-href="Test document" href="Test document" target="_blank" rel="noopener">This exists</a>
<br>
<a class="internal-link is-unresolved" data-href="Test2" href="Test2" target="_blank" rel="noopener">This doesn't exist</a>

I tried doing a quick search on the forum about this but didn't find anything.

Edit: Mentioned in the forum

@bennyxguo
Copy link
Owner

Thanks for the detail report, let me try it out.

@krokofant krokofant added the obsidian upstream Issue related to upstream obsidian functionality label Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request obsidian upstream Issue related to upstream obsidian functionality
Projects
None yet
Development

No branches or pull requests

3 participants