Rich text / foldkit-mixins-richtext

linkEdit

function · packages/mixins-richtext/src/link.ts:50

function linkEdit(
  document: RichText.Document,
  selection: RichText.Selection | null,
  draft: string,
): Option.Option<EditorEvent>

The edit applying a draft makes: the selection linked, or the link around the caret changed, to RichText.safeUrl(draft). None when the policy refuses the address, or when there is neither a range nor a caret inside a link to put it on. The view's button sends it; a caller handling submitted sends it from its own draft.