]> code.citadel.org Git - citadel.git/blobdiff - webcit/html2html.c
Move vcard.c into libcitadel.
[citadel.git] / webcit / html2html.c
index 6d028d49488ad82c9208c642a8ef6b5c54b00d39..893acf2a9fa56d49604fbeffc90586795d63152f 100644 (file)
@@ -8,7 +8,6 @@
  */
 /*@{*/
 #include "webcit.h"
-#include "vcard.h"
 #include "webserver.h"
 
 
@@ -139,7 +138,7 @@ void output_html(char *supplied_charset, int treat_as_wiki) {
        }
 
        /** Do a first pass to isolate the message body */
-       ptr = msg;
+       ptr = msg + 1;
        msgstart = msg;
        msgend = &msg[content_length];
 
@@ -306,7 +305,7 @@ void output_html(char *supplied_charset, int treat_as_wiki) {
                        }
                        sprintf(&converted_msg[output_length],
                                "<a href=\"display_enter?force_room=_MAIL_&recp=");
-                       output_length += 47;
+                       output_length += 46;
                        ptr = &ptr[16];
                        ++alevel;
                        ++brak;
@@ -376,6 +375,23 @@ void output_html(char *supplied_charset, int treat_as_wiki) {
                                        if (linklen > 0) break;
                                }
                                if (linklen > 0) {
+                                       char *ltreviewptr;
+                                       char *nbspreviewptr;
+                                       //* spot for some subject strings tinymce tends to give us.
+                                       ltreviewptr = strchr(ptr, '<');
+                                       if (ltreviewptr != NULL) {
+                                               *ltreviewptr = '\0';
+                                               linklen = ltreviewptr - ptr;
+                                       }
+
+                                       nbspreviewptr = strstr(ptr, "&nbsp;");
+                                       if (nbspreviewptr != NULL) {
+                                               ///*nbspreviewptr = '\0';
+                                               linklen = nbspreviewptr - ptr;
+                                       }
+                                       if (ltreviewptr != 0)
+                                               *ltreviewptr = '<';
+
                                        content_length += (32 + linklen);
                                        if (content_length >= converted_alloc) {
                                                converted_alloc += 8192;