Open juanfcocontreras opened 3 years ago
Thanks for filing, will correct it for the next release.
Punting to 0.4.6 later this week to not delay the current release too long.
The fix here got caught up in some other inline field improvements and will be released as part of 0.5.0.
I think the behavior in the image below could be related; first and second instances of the same field are treated differently. If field_a is stored in front matter all instances are treated as arrays of 3 elements
OS: Windows 10 Obsidian Version: 0.14.6 Dataview Version: 0.5.15
@whydnct I believe that behavior is because multiple field arrays with the same name are merged into one array - i.e., field_a
becomes [uno, 1, a, dos, 2, b]
rather than [[uno, 1, a], [dos, 2, b]]
. However, I think the behavior isn't quite right in that case as well.
I might be missing something, but I don't think it merges them that way: the 2nd query returns the first character of every element of the first field_a
, but only the first element of the second field_a
. It seems to me that both fields are treated differently.
Best inspect the index yourself by logging to console with `$=console.log(dv.current())`
after turning on inline DVJS.
Regarding the initial bug report: The syntax of lists in frontmatter and inline fields differ. In frontmatter it's elements: [3, 5, 6]
, inline its elements:: 3, 5, 6
. Using this syntax, I get your expected result. elements:: [3, 5, 6]
gets interpreted as a text and therefore elements[0]
gives you back the first character of the text.
Regarding @whydnct point, this input gives me the result blacksmithgu expects - an array consisting of two arrays.
a:: "aa", "ab", "ac"
a:: "ba", "bb", "bc"
```dataview
LIST a
WHERE file.path = this.file.path
results to:
![Image](https://user-images.githubusercontent.com/2006600/208263237-ae410754-a7b5-403b-96b6-64fba7551579.png)
Describe the bug When a list is used within an inline field, it is interpreted as a string. If the same field is used in the Frontmatter, it works as expected.
To Reproduce
Expected behavior
Desktop (please complete the following information):
Additional context
If the field is used in the frontmatter, it works as expected: