]> code.citadel.org Git - citadel.git/blobdiff - textclient/commands.c
Blockquotes are now rendered to console as dim instead of italic
[citadel.git] / textclient / commands.c
index 880d3ebc08139eb20e366683073d66ad63856cd1..cf3576d878eb6c3f7b21e051c656dfd20490aee6 100644 (file)
@@ -4,7 +4,7 @@
 // Copyright (c) 1987-2022 by the citadel.org team
 //
 // This program is open source software.  Use, duplication, and/or
-// disclosure are subject to the GNU General Purpose License version 3.
+// disclosure is subject to the GNU General Purpose License version 3.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -1406,6 +1406,7 @@ int fmout(int width,              // screen width to use
        char old = 0;           // The previous character
        int column = 0;         // Current column
        size_t i;               // Generic counter
+       int in_quote = 0;
 
        // Space for a single word, which can be at most screenwidth
        word = (char *) calloc(1, width);
@@ -1429,11 +1430,18 @@ int fmout(int width,            // screen width to use
 
        // Run the message body
        while (*e) {
+
                // Catch characters that shouldn't be there at all
                if (*e == '\r') {
                        e++;
                        continue;
                }
+
+               if ((in_quote) && (*e == '\n') && (enable_color)) {
+                       in_quote = 0;
+                       scr_printf("\033[22m\033[22m");
+               }
+
                if (*e == '\n') {       // newline?
                        e++;
                        if (*e == ' ') {        // paragraph?
@@ -1458,6 +1466,11 @@ int fmout(int width,             // screen width to use
                        continue;
                }
 
+               if ((*e == '>') && (column <= 1) && (!fpout) && (enable_color)) {
+                       in_quote = 1;
+                       scr_printf("\033[2m\033[2m");
+               }
+
                // Or are we looking at a space?
                if (*e == ' ') {
                        e++;