Fixing greentext patch
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
--- a/src/SlashCommands.tsx
|
--- a/src/slash-commands/SlashCommands.tsx
|
||||||
+++ b/src/SlashCommands.tsx
|
+++ b/src/slash-commands/SlashCommands.tsx
|
||||||
@@ -68,6 +68,29 @@
|
@@ -68,6 +68,29 @@
|
||||||
|
|
||||||
export const Commands = [
|
export const Commands = [
|
||||||
|
|||||||
32
patches/files/greentext_command.patch_backup
Normal file
32
patches/files/greentext_command.patch_backup
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
--- a/src/SlashCommands.tsx
|
||||||
|
+++ b/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, ">");
|
||||||
|
+ htmlGreentext = htmlGreentext.replace(/(?:\r\n|\r|\n)+/g, "<br />>");
|
||||||
|
+
|
||||||
|
+ 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"),
|
||||||
Reference in New Issue
Block a user