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

Function onGifCommand

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

replaceWordMethod · 0.80

Tested by

no test coverage detected