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.

Array interpreted as string in inline fields

See original GitHub issue

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

  1. Create a note with the following content:
elements:: [3, 5, 6]

#test 
  1. Create a note with the following content:
```dataview
table
elements[0] as "First"
from #test
```
  1. Turn on preview
  2. The result is:
File First
test_list [

Expected behavior

File First
test_list 3

Desktop (please complete the following information):

  • OS: macOS Catalina 0.15.7
  • Obsidian Version: 0.12.12
  • Dataview Version: 0.4.4

Additional context

If the field is used in the frontmatter, it works as expected:

---
elements: [3, 5, 6]
---

#test 

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
blacksmithgucommented, Sep 9, 2021

The fix here got caught up in some other inline field improvements and will be released as part of 0.5.0.

1reaction
blacksmithgucommented, Aug 24, 2021

Punting to 0.4.6 later this week to not delay the current release too long.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transform an array into a string inline - Stack Overflow
Use string.Join . In .NET 3.5 and earlier you need to convert to a string array first; in .NET 4 there's an overload...
Read more >
Java String Array- Tutorial With Code Examples
In the above String Array, the initializations are inline initializations. The String Array is initialized at the same time as it is declared....
Read more >
Array.from() - JavaScript - MDN Web Docs
The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.
Read more >
Zig Language Reference
Dereferencing string literals converts them to Arrays. ... in source code carry their UTF-8 meaning into the content of the string in the...
Read more >
Nim Manual - Nim Programming Language
(access a tuple/object field operator) and [] (array/string/sequence index operator) operators perform implicit dereferencing operations for reference types:
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