getLinkAndTagCompletionTrigger
Finds the [[ link or # tag being typed before the caret.
A link trigger is an unclosed [[ on the caret’s line with no | after it, so an alias being typed is left alone. A tag trigger is a # at the start of the text or after whitespace, followed only by tag characters.
Import:
import { getLinkAndTagCompletionTrigger } from '@mnaoumov/obsidian-lib/link-and-tag-input-suggest';Signature:
function getLinkAndTagCompletionTrigger(text: string, caret: number): LinkAndTagCompletionTrigger | nullParameters:
| Parameter | Type | Description |
|---|---|---|
text |
string | The text of the element. |
caret |
number | The offset of the caret. |
Returns: LinkAndTagCompletionTrigger | null — The trigger, or null when the caret is not in one.