'[]()' rendered as link in dv.pages() folder query, but string in #tag query
See original GitHub issueDescribe the bug
I’ve been trying to remap fields to create a new list of markdown links (i.e. [file.alias](file.path)
), and discovered that using identical queries with dv.pages()
creates different results depending on whether you’re querying a folder or a tag.
To Reproduce
- Create two dataviewjs blocks like this:
console.log(dv.pages("#project").map(k => '[' + k.file.name + '](' + k.file.path + ')'))
console.log(dv.pages('"Folder"').map(k => '[' + k.file.name + '](' + k.file.path + ')'))
- If you check the output, you’ll see each creates an array with identically formatted items:
"[name](path)"
- Now use dv.list() instead of logging to the console
dv.list(dv.pages("#project").map(k => '[' + k.file.name + '](' + k.file.path + ')'))
dv.list(dv.pages('"Folder"').map(k => '[' + k.file.name + '](' + k.file.path + ')'))
- You should see something like this:
In other words, a folder query actually renders the markdown, while a tag query simply displays the plaintext.
Expected behavior Instead, I’d expect each of these to be rendered the same, with working links to the notes. The source should have no effect on the way it’s rendered, no?
Desktop (please complete the following information):
- OS: MacOS Big Sur
- Obsidian Version [e.g. 0.12.13]
- Dataview Version [e.g. 0.4.4]
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Codeblock Reference - Dataview - GitHub Pages
Query methods allow you to query the Dataview index for page metadata; to render this data, use the methods in the render section....
Read more >DataviewJS query to render number of pages with given tag ...
Dear fellows, I tried a DataviewJS query to render the number of pages with a certain tag & a key value that is...
Read more >Obsidian Dataview - GitHub
Provides a JavaScript API and pipeline-based query language for filtering, sorting, and extracting data from Markdown pages. See the Examples section below ...
Read more >Razor Pages with Entity Framework Core in ASP.NET Core
Shows how to create a Razor Pages app using Entity Framework Core. ... async if they call EF Core methods that send queries...
Read more >How to get started with Obsidian Dataview and DataviewJS
“Treat your Obsidian Vault as a database which you can query from” ... dv.taskList(dv.pages().file.tasks.where(t => t.completed));
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nkoder I did some investigation and I think you are exactly correct. Obsidian does not like spaces in paths to markdown files, and will not render them as links unless you replace space with
%20
.As another option for this, note there is a link method
withDisplay
which lets you set the render for the link. Try this:Good to hear you found a workaround and you’ve found Dataview useful!
dv.func.link()
is also a good alternative here.