MetaEdit icon indicating copy to clipboard operation
MetaEdit copied to clipboard

Squar Brackets

Open MicheleDeZen opened this issue 2 years ago • 5 comments

I don't know if this is an issue or just me not understanding it correctly :

I have a dataview inline field like "[number:: 3]" and in a javascript view i am trying to increment the value by 1

I am using this code :

if (tag_type == "inline") {
  let value = await getPropertyValue(tag_name, note.file.path);
  console.log(value)
  value = value + amount;
  console.log(value)
  await update(tag_name, value, note.file.path);
}

If the field is written without any bracket like "number:: 3" it works, if i have it written like "[number:: 3]" it doesn't.

I think it is related to how the graphical tool is displaying the values image It seams like is reading the opening bracket in the key and the closing in the value image

MicheleDeZen avatar Apr 11 '22 12:04 MicheleDeZen

I have the same problem. If I have the inline dataview value in brackets or parentheses. Also, if the inline dataview field is in a callout, I get the quote symbol too.

obsdiain dataview issue with metaedit

SciJoy avatar Jun 16 '22 14:06 SciJoy

This also applies to lists, headers, and probably other characters too. image

Editing the value also contains things outside of the square brackets: image

It would be great if this is fixed because it's great being able to use this plugin without directly going into the callouts or back to live-preview to edit the value.

caasion avatar Jun 30 '22 22:06 caasion

Hey, any update on this? Currently facing this exact issue

j21w91 avatar Jul 20 '22 22:07 j21w91

Hey, the issue is probably related to the inline file parser and related to Issue #78. Currently the InlineFileParser only looks for '::' as the marker for dataview inline fields. However, dataview inline field can take two forms.

  1. without preceding and subsequent content as MyDataviewField:: Value, or
  2. within other content as [MyDataViewField:: Value] Note the differences are the brackets [ ... ]. This is where the issue occurs.

A fix for this would be to check for [ and ] within the parsed line containing a :: and limit the key and value parts accordingly (2nd form of dataview fields). However, if no brackets are found, it should be assumed that the 1st form is intended.

LuthanV avatar Aug 10 '22 19:08 LuthanV

Came across what seems to be this issue when tinkering with QuickAdd's example Movie script, which uses inline fields with lists of links:

category:: [[Movies]]
director:: [[Lana Wachowski]], [[Lilly Wachowski]]
genre:: [[Action]], [[Sci-Fi]]
cast:: [[Keanu Reeves]], [[Laurence Fishburne]], [[Carrie-Anne Moss]]

Unfortunately, MetaEdit's getPropertiesInFile returns

{ "key": "category", "content": "[[Movies", "type": 1 },
{ "key": "director", "content": "[[Lana Wachowski", "type": 1 },
{ "key": "genre", "content": "[[Action", "type": 1 },
{ "key": "cast", "content": "[[Keanu Reeves", "type": 1 },

Possibly related is #84

ZackBoe avatar Mar 06 '23 04:03 ZackBoe