Skip to content

findPluginNameMatches

Finds every whole-word occurrence of a plugin name in a text, skipping those inside a range an excluded pattern matches.

Matching is case-sensitive, so the lowercase dataview of an identifier or a package name is not a plugin name. A longer name wins over a shorter one it contains.

Import:

import { findPluginNameMatches } from '@mnaoumov/obsidian-dev-toolkit/linters/plugin-names';

Signature:

function findPluginNameMatches(text: string, pluginNames: readonly string[], excludedPatterns: readonly RegExp[]): PluginNameMatch[]

Parameters:

Parameter Type Description
text string The text to search.
pluginNames readonly string[] The names to look for.
excludedPatterns readonly RegExp[] Global patterns whose matches hide the names inside them: a code span, a link, a URL.

Returns: PluginNameMatch[] — The names found, in text order.