obsidian-db-folder
obsidian-db-folder copied to clipboard
[FR] search inline fields that do not start the line or be bold
First of all I'd like to thank you for this amazing plugin! Have been playing around with it an seems really useful.
In my vault I have Person notes where each person has its own note with properties like first name, last name, birthday, etc.
Each of these properties is managed using a Dataview inline field in an unordered list, e.g:
- First Name:: John
- Last Name:: Doe
- Birthday:: 28/03/1979

During some of these tests, I noticed that inline fields are also rendered correctly if they contain text before, like a dash.

When I change the value using the plugin like the following example, the updated value is correctly saved in the note

The value however is not update in the inline field, but added on top of the note as a new entry

I'm not a developer, but when looking in the source code for the term inline
, I came across the following line of code
array.push(
${key}:: ${inlineFields.inline[key]});
Could this be the reason that the dash in front of the inline field is ignored?
hi @galsom
I see the problem here. The plugin before add a new inline field search if it already exist, but the way it’s searched is being at start of a line
In you example the inline field is behind a - So the plugin thinks that does not exist and add a new one. I am afraid that changes thst behaviour to edit that case its not trivial but could be added to the roadmap
While this issue is into the backlog, you can use the editing option by replacing:
- Birthday:: x/y/z
for:
Birthday:: x/y/z
Thank you for the tip of using it without an unordered list. The disadvantage that that has is that when you render the MarkDown, all the values are placed on one line by convention:

That is why I started using the unordered lists. If somebody has another idea, please do share :-).
In the mean time I look forward to all the progress you make and hopefully this can be added.
New regex expression:
const inlineFieldRegex = new RegExp(`(^|(.*)(\\s))([_\\*~\`]{ 0, 2}${columnId}[_\\*~\`]{ 0, 2}[:]{2}\\s)+([\\w\\W]+?$)`, 'gm');
https://user-images.githubusercontent.com/11924043/187700499-299cc39e-24aa-44ac-8e57-62fa5e3bd4b8.mov
works for write but dataview needs parentheses between key:: value to read it. Working on another one
Edit: To replace new values without affects the text after parentheses the plugin needs the previous value and that implies more work that I expected
I have a solid candidate => https://regex101.com/r/22g1JC/1