Skip to content

canonicalizeObsidianText

Canonicalizes text for Obsidian Search and unlinked mentions’ non-Unicode ignore-case regex matching.

Preserves UTF-16 length, lone surrogates and accents. This is not Unicode or locale case folding: Greek final sigma folds to sigma’s uppercase, but Kelvin sign, long s and dotless i do not fold to ASCII. Verified against core Search’s gmi expressions in Obsidian 1.14.5 and 1.15.0.

Import:

import { canonicalizeObsidianText } from '@mnaoumov/obsidian-lib/obsidian-word-characters';

Signature:

function canonicalizeObsidianText(text: string): string

Parameters:

Parameter Type Description
text string The literal text, not a regular expression source.

Returns: string — Its ECMAScript non-Unicode ignore-case canonical form.