Skip to content

getForbiddenCharacterReplacementValidationMessage

Validates the text a forbidden character is replaced with.

Every platform’s set is checked, not only the enabled ones: the toggles can change after the replacement is chosen, and a replacement one platform refuses would make the repair of that platform produce a name that is still invalid there.

Import:

import { getForbiddenCharacterReplacementValidationMessage } from '@mnaoumov/obsidian-lib/path-compatibility';

Signature:

function getForbiddenCharacterReplacementValidationMessage(replacement: string): string

Parameters:

Parameter Type Description
replacement string The replacement text. Empty is valid and deletes the character.

Returns: string — A message naming the first refused character, or an empty string when the replacement is valid.


Links to this page: