From 7a869a457be64a554cb38d4c3ab271a93700ffe1 Mon Sep 17 00:00:00 2001 From: q Date: Sun, 15 Feb 2026 15:24:38 -0500 Subject: [PATCH] Fixing greentext patch --- patches/files/greentext_command.patch | 4 +-- patches/files/greentext_command.patch_backup | 32 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 patches/files/greentext_command.patch_backup diff --git a/patches/files/greentext_command.patch b/patches/files/greentext_command.patch index ce3c9ca..9c2e709 100644 --- a/patches/files/greentext_command.patch +++ b/patches/files/greentext_command.patch @@ -1,5 +1,5 @@ ---- a/src/SlashCommands.tsx -+++ b/src/SlashCommands.tsx +--- a/src/slash-commands/SlashCommands.tsx ++++ b/src/slash-commands/SlashCommands.tsx @@ -68,6 +68,29 @@ export const Commands = [ diff --git a/patches/files/greentext_command.patch_backup b/patches/files/greentext_command.patch_backup new file mode 100644 index 0000000..ce3c9ca --- /dev/null +++ b/patches/files/greentext_command.patch_backup @@ -0,0 +1,32 @@ +--- a/src/SlashCommands.tsx ++++ b/src/SlashCommands.tsx +@@ -68,6 +68,29 @@ + + export const Commands = [ + new Command({ ++ command: "greentext", ++ args: "", ++ description: _td("4chan-like greentext arrows"), ++ runFn: function(cli, roomId, threadId, args) { ++ const texts = args.split(/\n{2,}(.+|\n+)/g); ++ const greentext = texts[0]; ++ const normalText = texts[1] || ""; ++ ++ let plainGreentext = greentext.replace(/^/g, ">"); ++ plainGreentext = plainGreentext.replace(/(?:\r\n|\r|\n)+/g, "\n>"); ++ ++ let htmlGreentext = greentext.replace(/^/g, ">"); ++ htmlGreentext = htmlGreentext.replace(/(?:\r\n|\r|\n)+/g, "
>"); ++ ++ return success(ContentHelpers.makeHtmlMessage( ++ plainGreentext + "\n" + normalText, ++ `${htmlGreentext}
${normalText}`, ++ )); ++ }, ++ category: CommandCategories.messages, ++ }), ++ ++ new Command({ + command: "spoiler", + args: "", + description: _td("slash_command|spoiler"),