Open Vulpes4 opened 10 months ago
All of these seems to work just fine:
---
task1: value1
task-3: value3
---
task2:: value2
task-4:: value4
`=this.task1`
`=this.task2`
`=this.task-3`
`=this.task-4`
Output:
This is tested using Dataview 0.5.64 (and .60 first :) ) in Obsidian 1.4.16. How does it look in your setup? Or how did I misinterpret the bug use case?
@holroy
Ok, my bad. For some reason it works.
Something like this doesn't work:
---
1-task
---
`=this.1-task`
=this.1-task
I think you're touching in on variable naming issues, similar to those using from
or where
as variable names, and in this case you're variable name is starting with a number, which can cause issues. In dataviewjs you'll definitively need to use one of the alternate forms for accessing the variable as it would read as fetch the variable this.1
and subtract task
from it.
That's a rather longwinded way of saying, you should use `= this["1-task"] `
when your variable name starts with a number.
A tip to see how Dataview interprets variables can be done using: `$= dv.span(dv.current()) `
which in this case shows that your 1-task
variable is declared just as it should be, but it is indeed a little harder to get at due to the number in front of the name.
What happened?
Dataview does not render a property correctly when it has a number or a special sign like "-" in her name. It works when the name of the property doesn't include numbers. For example '=this.task' works fine.
DQL
'=this.task1'
JS
Dataview Version
0.5.64
Obsidian Version
1.4.16
OS
Windows