"), 0);
+ }
ptr = msg;
msgend = strchr(msg, 0);
while (ptr < msgend) {
@@ -301,7 +372,7 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
if (!strncasecmp(ptr, "')))
- ) {
+ && ((strchr(ptr, '/') < strchr(ptr, '>')))
+ ) {
/* open external links to new window */
StrBufAppendPrintf(converted_msg, new_window);
ptr = &ptr[8];
}
- else if ( (treat_as_wiki) && (strncasecmp(ptr, "CurRoom.name, NULL);
+ StrBufAppendPrintf(converted_msg, "?page=");
ptr = &ptr[9];
}
else {
@@ -329,27 +407,39 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
}
/** Fixup ');
- char* src=strstr(ptr, " src=\"cid:");
char *cid_start, *cid_end;
- ++brak;
+ char* tag_end=strchr(ptr,'>');
+ char* src;
+ /* FIXME - handle this situation (maybe someone opened an ') {
- --brak;
- if ((scriptlevel == 0) && (script_start_pos >= 0)) {
- StrBufCutRight(converted_msg, StrLength(converted_msg) - script_start_pos);
- script_start_pos = (-1);
+
+ if ((ptr >= msg) && (ptr <= msgend)) {
+ /*
+ * We need to know when we're inside a tag,
+ * so we don't turn things that look like URL's into
+ * links, when they're already links - or image sources.
+ */
+ if ((ptr > msg) && (*(ptr-1) == '<')) {
+ ++brak;
}
+ if ((ptr > msg) && (*(ptr-1) == '>')) {
+ --brak;
+ if ((scriptlevel == 0) && (script_start_pos >= 0)) {
+ StrBufCutRight(converted_msg, StrLength(converted_msg) - script_start_pos);
+ script_start_pos = (-1);
+ }
+ }
+ if (!strncasecmp(ptr, "", 3)) --alevel;
}
- if (!strncasecmp(ptr, "", 3)) --alevel;
+ }
+
+ if (BodyArea != NULL) {
+ StrBufAppendBufPlain(converted_msg, HKEY(" |