FrontmatterFormattingPreserver
A rewrite of a note’s front matter that keeps the author’s original formatting wherever the change does not reach it.
It is handed the whole note and the front matter to write, and returns the whole new note — or null when it cannot be faithful, which hands the write back to setFrontmatter’s own parse-and-stringify path. Returning null is never an error: it is how the preserver guarantees it can only ever match or improve on that path, never do worse than it.
Import:
import type { FrontmatterFormattingPreserver } from 'obsidian-dev-utils/obsidian/frontmatter';Signature:
export type FrontmatterFormattingPreserverSignature:
type FrontmatterFormattingPreserver = (this: void, content: string, newFrontmatter: object) => null | stringType: (this: void, content: string, newFrontmatter: object) => null | string
Links to this page: