Update Note.renderValueString() in note.ts#792
Open
FMeinicke wants to merge 1 commit into
Open
Conversation
d25747c to
d49aad0
Compare
to allow correct rendering of formula fields when the value is an array. Before, arrays would be enclosed in double quotes, which made Obsidian think that the value was a string that happened to have commas in it when it should have been an array instead. Use the indented list style to render arrays, as it turns out, Obsidian will automatically reformat frontmatter fields with type 'list' to the indented list style when the value was previously an inline array. This reformatting is done when another frontmatter field is modified (e.g., removed in case of a list style field). This change of the field value subsequently results in invalid YAML being generated for the frontmatter because MetadataMenu will add the inline array style value where Obsidian had put the indented list style. The only way around this IMO is to force the indented list style for formula field values that are arrays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to allow correct rendering of formula fields when the value is an array.
Before, arrays would be enclosed in double quotes, which made Obsidian think that the value was a string that happened to have commas in it when it should have been an array instead.
Use the indented list style to render arrays, as it turns out, Obsidian will automatically reformat frontmatter fields with type 'list' to the indented list style when the value was previously an inline array. This reformatting is done when another frontmatter field is modified (e.g., removed in case of a list style field).
This change of the field value subsequently results in invalid YAML being generated for the frontmatter because MetadataMenu will add the inline array style value where Obsidian had put the indented list style. The only way around this IMO is to force the indented list style for formula field values that are arrays.
Would fix #782, and fix #486.