MCPcopy Create free account
hub / github.com/dailydotdev/apps / onGifCommand

Function onGifCommand

packages/shared/src/hooks/input/useMarkdownInput.ts:568–577  ·  view source on GitHub ↗
(gifUrl: string, altText: string)

Source from the content-addressed store, hash-verified

566 };
567
568 const onGifCommand = async (gifUrl: string, altText: string) => {
569 const textareaCommand = getCommand();
570 const replace: GetReplacementFn = (type, { trailingChar }) => {
571 const replacement = `${
572 !trailingChar ? '' : '\n\n'
573 }![${altText}](${gifUrl})\n\n`;
574 return { replacement };
575 };
576 await textareaCommand.replaceWord(replace, onUpdate);
577 };
578
579 const onPaste: ClipboardEventHandler<HTMLTextAreaElement> = async (e) => {
580 const pastedText = e.clipboardData.getData('text');

Callers

nothing calls this directly

Calls 1

replaceWordMethod · 0.80

Tested by

no test coverage detected