I tried some variants for a text and a link with punctuation, which produces the following view with source mode to the left, and reading mode to the right:
The second alternative didn’t enjoy being too close to the definition, as it then failed to do the query on the immediate following line (which could be a bug, not sure on that one), but it does get the value of title2
correct.
Which is better? Hard to say, but I tend to use no quotes, as long as I can. The icky part comes when adding dates and duration and trying to define multiple values in the same line. I’ve not fiddled enough to say conclusively then that this or that is the better option.
Here is a similar case, showing some of the challenges with multiple values for durations and names:
If the duration is properly parsed, it’ll calculate the proper way to write it, so we see that dur3
is just texts (or strings), but multiple values. But how do you get multiple durations on one line? Not dur2
, as that sums it up, so in my short test period, I had to do two definitions, as for dur4
to get two durations. Not sure if a better way exists.
And if you want multiple names to actually be a list, you have to use quotes to separate the values.
So what does this mean, is it better with quotes or not? What if we add some dates into the mix, as well. How do we preserve those, as single values or multiple values?
Here we see that we need to not use quotes to get it to actually be a date (which we can add durations like a day to). See how the quoted versions, just adds the text “1 days” to the text of “2023-01-21”.
So it’s a little finicky depending on your values, and what you want out of it. Sometimes you do need the quotes, and sometimes it’s better to not use the. Sorry for any confusion I’ve created for you!
Full markdown for these images
### Quotes
title1:: "Harry Potter! and the Philosopher's Stone [[Note 1]], 60 m"
Title1 is `$= dv.current().title1 `
### Square brackets
[title2:: Harry Potter! and the Philosopher's Stone [[Note 1]], 60 m ]
Title2 is `$= dv.current().title2 `
Title2 is `$= dv.current().title2 `
### Nothing
title3:: Harry Potter! and the Philosopher's Stone [[Note 1]], 60 m
Title3 is `$= dv.current().title3 `
dur1:: 58 m 120s
dur2:: 58 m 120s, 59 m 60s
dur3:: "58m 120s", "59m 60s"
[dur4:: 58m 120s], [dur4:: 59m 60s]
```dataview
table without id dur1, dur2, dur3, dur4
WHERE file.name = this.file.name
```
multi1:: John Smith, Jane Doe
multi2:: "John Smith", "Jane Doe"
```dataview
table without id multi1, multi2
WHERE file.name = this.file.name
```
date1:: 2023-01-01
date2:: 2023-01-11, 2023-01-12
date3:: "2023-01-21", "2023-01-22"
```dataview
table without id date1, date2, date3
WHERE file.name = this.file.name
```
```dataview
table without id
date1 + dur(1 day),
date2[0] + dur(1 day),
date3[0] + dur(1 day)
WHERE file.name = this.file.name
```