From 8afcb8e4dd58efdb886fd7efb9890f64e6dc2bbe Mon Sep 17 00:00:00 2001 From: Supertiger Date: Fri, 23 Aug 2024 14:36:47 -0700 Subject: [PATCH] new plugin NoMaskedLinkPaste (#2782) Co-authored-by: v --- src/plugins/noMaskedUrlPaste/README.md | 3 +++ src/plugins/noMaskedUrlPaste/index.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/plugins/noMaskedUrlPaste/README.md create mode 100644 src/plugins/noMaskedUrlPaste/index.ts diff --git a/src/plugins/noMaskedUrlPaste/README.md b/src/plugins/noMaskedUrlPaste/README.md new file mode 100644 index 000000000..36707ac93 --- /dev/null +++ b/src/plugins/noMaskedUrlPaste/README.md @@ -0,0 +1,3 @@ +# NoMaskedUrlPaste + +Pasting a link while you have text selected will NOT paste your link as a masked link. diff --git a/src/plugins/noMaskedUrlPaste/index.ts b/src/plugins/noMaskedUrlPaste/index.ts new file mode 100644 index 000000000..64f522cae --- /dev/null +++ b/src/plugins/noMaskedUrlPaste/index.ts @@ -0,0 +1,23 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2023 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants.js"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "NoMaskedUrlPaste", + authors: [Devs.CatNoir], + description: "Pasting a link while having text selected will not paste as masked URL", + patches: [ + { + find: ".selection,preventEmojiSurrogates:", + replacement: { + match: /if\(null!=\i.selection&&\i.\i.isExpanded\(\i.selection\)\)/, + replace: "if(false)" + } + } + ], +});