Skip to content

enableFrontmatterFormattingPreservation

Registers this module’s engine as the front matter formatting preserver for every write this library performs.

Call it once, from a plugin’s onloadImpl(). It takes effect for processFrontmatter(), applyFileChanges() and every other path that reaches setFrontmatter(), including the ones the calling plugin does not invoke itself.

There is one preserver per realm, so two plugins that both call this simply agree.

Import:

import { enableFrontmatterFormattingPreservation } from 'obsidian-dev-utils/obsidian/frontmatter-formatting';

Signature:

function enableFrontmatterFormattingPreservation(): void

Returns: void


Links to this page: