question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link rendering doesn't differentiate existing vs non existing files

See original GitHub issue

What happened?

When I render a file link to a file that doesn’t exist, the link shows up the same as when the file does exist.

When I create links without using dataview, then links to files that don’t exist are rendered in a lighter color. The following screenshot demonstrates the difference: image

Test case

Here is a sample text (note that PageA exists, but PageB does not):

[[PageA]] exists but [[PageB]] doesn't exist

```dataviewjs
dv.span(
  `${dv.fileLink("PageA")} exists but ${dv.fileLink("PageB")} doesn't exist`
);
```

DQL

No response

JS

dv.span(
  `${dv.fileLink("PageA")} exists but ${dv.fileLink("PageB")} doesn't exist`
);

Dataview Version

0.5.41

Obsidian Version

0.15.9

OS

MacOS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
renarlcommented, Aug 16, 2022

Yes, parity with Obsidian’s behavior would be great. I’m auto-generating links, and it’s important to know if the link target exists or not.

I’m happy to try a workaround if you have suggestions.

1reaction
blacksmithgucommented, Aug 30, 2022

As far as I know, there isn’t much I can do about this in the general case of “render text with links in it”, since all Dataview is doing is calling the obsidian markdown API (MarkdownRenderer.renderMarkdown), which is actually responsible for rendering links. I.e., this is an issue with the obsidian API and not dataview in particular (you may see this behavior in similar plugins which render markdown).

I can special case the rendering of standalone links in tables to explicitly do the check and add the appropriate CSS, though that is about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client-side vs. server-side rendering: why it's not all black and ...
Server-side rendering is the most common method for displaying information onto the screen. It works by converting HTML files in the server into ......
Read more >
Render partial from different folder (not shared) - Stack Overflow
In my case I was using MvcMailer (https://github.com/smsohan/MvcMailer) and wanted to access a partial view from another folder, that wasn't in "Shared.
Read more >
Rendering on the Web
There is a longstanding debate over the correct applications of server rendering versus client-side rendering, but it's important to remember ...
Read more >
Basics of rendering and exporting in After Effects CC
Learn how to render and export in After Effects using the Render Queue panel and Media Encoder and what are the supported output...
Read more >
Copy files in Linux, avoid the copy if files do exist in destination
Just use cp -n <source> <dest> . From man page: -n, --no-clobber. do NOT overwrite an existing file (overrides a previous -i option)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found