Refactoring to use frantic from paranoia.wf's format. Greentext is back

This commit is contained in:
q
2024-09-14 16:49:09 -04:00
parent aaf2d53722
commit ad9865b747
31 changed files with 1756 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
--- a/node_modules/matrix-react-sdk/src/SlashCommands.tsx
+++ b/node_modules/matrix-react-sdk/src/SlashCommands.tsx
@@ -68,6 +68,29 @@
export const Commands = [
new Command({
+ command: "greentext",
+ args: "<message>",
+ 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, "&gt;");
+ htmlGreentext = htmlGreentext.replace(/(?:\r\n|\r|\n)+/g, "<br />&gt;");
+
+ return success(ContentHelpers.makeHtmlMessage(
+ plainGreentext + "\n" + normalText,
+ `<font color="#789922">${htmlGreentext}</font><br/>${normalText}`,
+ ));
+ },
+ category: CommandCategories.messages,
+ }),
+
+ new Command({
command: "spoiler",
args: "<message>",
description: _td("slash_command|spoiler"),