X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fhtml_to_ascii.c;h=5ea1e2756623e57c362c6a12b3dcd331b906d36b;hb=94849fa2121eef82d797137193a2ee6eac56bc96;hp=29d0e31c44924568b97f03756c22f7e64845fdab;hpb=e83d78b9d9bd2d5ad7b440fd6bc01efae2ad8cf6;p=citadel.git diff --git a/libcitadel/lib/html_to_ascii.c b/libcitadel/lib/html_to_ascii.c index 29d0e31c4..5ea1e2756 100644 --- a/libcitadel/lib/html_to_ascii.c +++ b/libcitadel/lib/html_to_ascii.c @@ -1,6 +1,6 @@ /* * Functions which handle translation between HTML and plain text - * Copyright (c) 2000-2010 by the citadel.org team + * Copyright (c) 2000-2018 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,9 +47,8 @@ * * inputmsg = pointer to raw HTML message * screenwidth = desired output screenwidth - * do_citaformat = set to 1 to indent newlines with spaces */ -char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat) { +char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth) { char inbuf[SIZ]; int inbuf_len = 0; char outbuf[SIZ]; @@ -198,6 +197,9 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci strcat(outbuf, nl); } +/**** + These seemed like a good idea at the time, but it just makes a mess. + else if ( (!strcasecmp(tag, "B")) || (!strcasecmp(tag, "/B")) @@ -205,7 +207,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci || (!strcasecmp(tag, "/STRONG")) ) { strcat(outbuf, "*"); - } else if ( @@ -215,7 +216,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci || (!strcasecmp(tag, "/EM")) ) { strcat(outbuf, "/"); - } else if ( @@ -223,8 +223,8 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci || (!strcasecmp(tag, "/U")) ) { strcat(outbuf, "_"); - } +****/ else if (!strcasecmp(tag, "BR")) { strcat(outbuf, nl); @@ -543,11 +543,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci strncpy(&outptr[output_len], outbuf, i+1); output_len += (i+1); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } - strcpy(outbuf, &outbuf[i+1]); i = 0; did_out = 1; @@ -567,10 +562,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci output_len += rb; strcpy(&outptr[output_len], nl); output_len += strlen(nl); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } strcpy(outbuf, &outbuf[rb+1]); } else { strncpy(&outptr[output_len], outbuf, @@ -578,10 +569,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci output_len += (screenwidth-2); strcpy(&outptr[output_len], nl); output_len += strlen(nl); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } strcpy(outbuf, &outbuf[screenwidth-2]); } }