]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/html_to_ascii.c
Make the swap buffer content function publically available.
[citadel.git] / libcitadel / lib / html_to_ascii.c
index 9a898cb70c5ed98853f16771305e3232e917f91b..29d0e31c44924568b97f03756c22f7e64845fdab 100644 (file)
@@ -2,7 +2,7 @@
  * Functions which handle translation between HTML and plain text
  * Copyright (c) 2000-2010 by the citadel.org team
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
  * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
@@ -67,6 +67,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
        int bytes_processed = 0;
        char nl[128];
 
+       tag[0] = '\0';
        strcpy(nl, "\n");
        inptr = inputmsg;
        strcpy(inbuf, "");
@@ -469,6 +470,16 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                strcpy(&outbuf[i+1], &outbuf[i+7]);
                        }
 
+                       else if (!strncasecmp(&outbuf[i], "’", 7)) {
+                               outbuf[i] = '\'';
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
+                       }
+
+                       else if (!strncasecmp(&outbuf[i], "–", 7)) {
+                               outbuf[i] = '-';
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
+                       }
+
                        /* two-digit decimal equivalents */
                        else if (outbuf[i] == '&'       &&
                                 outbuf[i + 1] == '#'   &&
@@ -508,7 +519,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                scanch = 0;
                                sscanf(&outbuf[i+2], "%04d", &scanch);
                                outbuf[i] = scanch;
-                               strcpy(&outbuf[i+1], &outbuf[i+6]);
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
                        }
 
                }