Equicord/src/plugins/fixCodeblockGap/index.ts

24 lines
698 B
TypeScript
Raw Normal View History

2024-01-06 03:05:23 +01:00
/*
2024-04-17 14:29:47 -04:00
* Vencord, a Discord client mod
2024-01-06 03:05:23 +01:00
* Copyright (c) 2023 Vendicated and contributors
2024-04-17 14:29:47 -04:00
* SPDX-License-Identifier: GPL-3.0-or-later
*/
2024-01-06 03:05:23 +01:00
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "FixCodeblockGap",
description: "Removes the gap between codeblocks and text below it",
authors: [Devs.Grzesiek11],
patches: [
{
2024-06-13 23:28:38 -03:00
find: String.raw`/^${"```"}(?:([a-z0-9_+\-.#]+?)\n)?\n*([^\n][^]*?)\n*${"```"}`,
2024-01-06 03:05:23 +01:00
replacement: {
match: String.raw`/^${"```"}(?:([a-z0-9_+\-.#]+?)\n)?\n*([^\n][^]*?)\n*${"```"}`,
replace: "$&\\n?",
},
},
],
});