* fix the 'trilcat pastes url in webcit with trash at the end' incident.
authorWilfried Göesgens <willi@citadel.org>
Thu, 12 Jul 2007 22:29:19 +0000 (22:29 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 12 Jul 2007 22:29:19 +0000 (22:29 +0000)
webcit/html2html.c

index da668c71cdc985440a268689e891620daf5fed58..b15455b675b7861577e7ea19316ebc33ddfa51fa 100644 (file)
@@ -376,6 +376,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;