X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fhtml_to_ascii.c;fp=libcitadel%2Flib%2Fhtml_to_ascii.c;h=33373c19d3c44cd4f75a28d2a457f09ba3d3e12c;hb=274c95e13b3868d29c4790a4603f27c0a04616aa;hp=2d604ac4fa3ab250519e022fca2d988f8bf3aaaf;hpb=4df5f560d552000f252a0e4dda2026b7a0373f0c;p=citadel.git diff --git a/libcitadel/lib/html_to_ascii.c b/libcitadel/lib/html_to_ascii.c index 2d604ac4f..33373c19d 100644 --- a/libcitadel/lib/html_to_ascii.c +++ b/libcitadel/lib/html_to_ascii.c @@ -185,34 +185,52 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int ansi) strcat(outbuf, nl); } -#if 0 - These seemed like a good idea at the time, but it just makes a mess. - else if ( (!strcasecmp(tag, "B")) - || (!strcasecmp(tag, "/B")) || (!strcasecmp(tag, "STRONG")) + ) { + if (ansi) { + strcat(outbuf, "\033[1m"); + } + } + else if ( + (!strcasecmp(tag, "/B")) || (!strcasecmp(tag, "/STRONG")) ) { - strcat(outbuf, "*"); + if (ansi) { + strcat(outbuf, "\033[22m"); + } } else if ( (!strcasecmp(tag, "I")) - || (!strcasecmp(tag, "/I")) || (!strcasecmp(tag, "EM")) - || (!strcasecmp(tag, "/EM")) ) { - strcat(outbuf, "/"); + if (ansi) { + strcat(outbuf, "\033[3m"); + } } else if ( - (!strcasecmp(tag, "U")) - || (!strcasecmp(tag, "/U")) + (!strcasecmp(tag, "/I")) + || (!strcasecmp(tag, "/EM")) ) { - strcat(outbuf, "_"); + if (ansi) { + strcat(outbuf, "\033[23m"); + } + } + + else if (!strcasecmp(tag, "U")) { + if (ansi) { + strcat(outbuf, "\033[4m"); + } + } + + else if (!strcasecmp(tag, "/U")) { + if (ansi) { + strcat(outbuf, "\033[24m"); + } } -#endif else if (!strcasecmp(tag, "BR")) { strcat(outbuf, nl);