new plugin NoMaskedLinkPaste (#2782)
Co-authored-by: v <vendicated@riseup.net>
This commit is contained in:
parent
2569c39ddf
commit
8afcb8e4dd
3
src/plugins/noMaskedUrlPaste/README.md
Normal file
3
src/plugins/noMaskedUrlPaste/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# NoMaskedUrlPaste
|
||||||
|
|
||||||
|
Pasting a link while you have text selected will NOT paste your link as a masked link.
|
23
src/plugins/noMaskedUrlPaste/index.ts
Normal file
23
src/plugins/noMaskedUrlPaste/index.ts
Normal file
|
@ -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)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
Loading…
Reference in a new issue