blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

Bug report : dataview syntax could be apply in normal inline code block with specific char , but it‘s just plain text. #1459

Open ancion opened 2 years ago

ancion commented 2 years ago

What happened?

my notes content is : support operation : = , < , >, In

get parsing error

image

which Corrupted the content of my notes。 I just want a plain text. I don't write something like

image

but it triggle dataview syntax parsing.

DQL

No response

JS

No response

Dataview Version

0.5.46

Obsidian Version

0.15.9

OS

Windows

mnvwvnm commented 2 years ago

The issue is related with the inline query prefix "=". Go to settings > Dataview and change the default "=" to another one (for example dv).

image
ancion commented 2 years ago

equals  =  used more frequently in  inline block, It could be possible change default value to  another  char?  such  as js inline query prefix is  $= ,  inline query prefix  should be  /=  or something else like that. Just for a little advice.

image

Because I realized something like ==highlight== could not work correctly.

AB1908 commented 2 years ago

Can you explain the fix you want to see implemented? The option to change it exists so changing the defaults doesn't make sense to me since this might break a lot of users' workflows.

tophee commented 1 year ago

I ran into the same issue. I had `==` as part of my text and it took me quite some time to figure out what the problem was. From the above, I now understand that the only way of solving this is by changing the default inline query prefix. I changed it to ===.

I think it would be a good idea to not have a simple = as the default prefix, given that the occurrence of it in inline code is rather common. Setting === as the default prefix could prevent the issues associated with this.

x3rAx commented 1 year ago

I also just stumbled across this and my solution is now that I set the inline prefix to {dataview}: and the inline JS prefix to {dataviewjs}:. This is consistent with the block style queries and is unlikely to be typed by accident :sweat_smile: