Skip to content

dvField does not work with bracketed inline fields #108

@ssBandit

Description

@ssBandit

Dataview has 3 ways to mark the data:

name:: 5
[name:: 5]
(name:: 5)

(with the last 2 being decorative that it uses for styling)

But tracker only supports the first type.
The following gives a "No valid Y value found in notes" error for all expect the first option

searchType: dvField
searchTarget: name
line:

After some probing I think the way to fix it is to just adjust the regex it uses to find the target to include possible brackets.

(^| |\t)\*{0,2}name\*{0,2}(::[ |\t]*(?<value>[\d\.\/\-\w,@; \t:]*))

           V                                                                 V
(^| |\t)(\[|\()?\*{0,2}name\*{0,2}(::[ |\t]*(?<value>[\d\.\/\-\w,@; \t:]*)(\]|\))?)

(only tested in an regex tester with some brackets and spaces combos. could be some edge cases I don't know about)

For now the workaround I found (besides doing a regex search) is to put a space after the opening bracket and a newline before the closing one. This keeps the styling and tracker can see it.

[ name:: 5
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions