refactor: disable builtin paste handler

pull/147/merge
moonrailgun 2 years ago
parent b72e0d5f46
commit b3015401b2

@ -36,15 +36,17 @@ export class ClipboardHelper {
} }
get builtinHandlers(): ChatInputPasteHandler[] { get builtinHandlers(): ChatInputPasteHandler[] {
return [ const pasteUrl: ChatInputPasteHandler = {
{ name: 'pasteUrl',
name: 'pasteUrl', label: t('转为Url富文本'),
label: t('转为Url富文本'), match: (e) => e.clipboardData.getData('text/plain').startsWith('http'),
match: (e) => e.clipboardData.getData('text/plain').startsWith('http'), handler: (data, { applyMessage }) => {
handler: (data, { applyMessage }) => { applyMessage(getMessageTextDecorators().url(data.text));
applyMessage(getMessageTextDecorators().url(data.text));
},
}, },
};
return [
// pasteUrl
]; ];
} }

Loading…
Cancel
Save