Closed PaperOrb closed 2 years ago
hi @PaperOrb After edit a cell, the plugin check every field inside the frontmatter and adds commas wrapping the text if it’s necessary.
In your image, those fields than lose their commas looks like they do not need it but url field cause it contains “:”
Could you attach the db file and some example with the original text to test it? I cant see what’s the problem
Hey @RafaelGB, here's the DB and a file to test it with: folder db test.md FINAL FANTASY VII (2013).md
thanks! Will be added to bugs in roadmap
The notes seem to be generated by my Media DB Plugin.
For that plugin, I wrote my own YAML stringifier that consistently adds quotation marks around strings. Mostly because I prefer it that way.
I am guessing that the db folder plugin replaces the entire frontmatter block and uses the obsidian API YAML stringifier for that.
hi @mProjectsCode . I am afraid that the plugin use the dataview parser with all the fields. I added a proxy between to give it some value with quotes in some cases. I can add more uses cases to fix your issue
thanks for the quick answer.
I personally think a setting to always add quotation marks to strings would be nice.
That also seems to be the simplest way to resolve the small "conflict" between our plugins. I will also work on an option to only add quotation marks only where it is necessary for my plugin.
We can collaborate to obtain the best parsing. In src/services/DataviewService.ts is the behaviour of the writing quotes:
private handleMarkdownBreaker(value: string, isInline?: boolean): string {
if (isInline) {
return value;
}
// Check possible markdown breakers of the yaml
if (MarkdownBreakerRules.INIT_CHARS.some(c => value.startsWith(c)) ||
MarkdownBreakerRules.BETWEEN_CHARS.some(rule => value.includes(rule)) ||
MarkdownBreakerRules.UNIQUE_CHARS.some(c => value === c)) {
value = value.replaceAll(`"`, `\\"`);
return `"${value}"`;
}
return value;
}
New property added to select your editing preferences
Looks great, except that it also adds quotation marks around non-strings like booleans and numbers.
Fixed too :)
Selecting a personalRating:
Causes modifications to unrelated fields inside the note which breaks things:
Here's the settings for that personalRating column:
Using Ubuntu 21.04 with obsidian 0.14.15