| 1151 { |
1151 { |
| 1152 /* TODO: Coalesce nested tags into one <f> tag! |
1152 /* TODO: Coalesce nested tags into one <f> tag! |
| 1153 * Currently, the 's' value will be overwritten when b/i/u is nested |
1153 * Currently, the 's' value will be overwritten when b/i/u is nested |
| 1154 * within another one, and only the inner-most formatting will be |
1154 * within another one, and only the inner-most formatting will be |
| 1155 * applied to the text. */ |
1155 * applied to the text. */ |
| 1156 if (!stricmp(root->name, "root")) { |
1156 if (!strcmp(root->name, "root")) { |
| 1157 *begin = g_strdup(""); |
1157 *begin = g_strdup(""); |
| 1158 *end = g_strdup(""); |
1158 *end = g_strdup(""); |
| 1159 } else if (!stricmp(root->name, "b")) { |
1159 } else if (!strcmp(root->name, "b") || !strcmp(root->name, "B")) { |
| 1160 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_BOLD); |
1160 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_BOLD); |
| 1161 *end = g_strdup("</f>"); |
1161 *end = g_strdup("</f>"); |
| 1162 } else if (!stricmp(root->name, "i")) { |
1162 } else if (!strcmp(root->name, "i") || !strcmp(root->name, "I")) { |
| 1163 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_ITALIC); |
1163 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_ITALIC); |
| 1164 *end = g_strdup("</f>"); |
1164 *end = g_strdup("</f>"); |
| 1165 } else if (!stricmp(root->name, "u")) { |
1165 } else if (!strcmp(root->name, "u") || !strcmp(root->name, "U")) { |
| 1166 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_UNDERLINE); |
1166 *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_UNDERLINE); |
| 1167 *end = g_strdup("</f>"); |
1167 *end = g_strdup("</f>"); |
| 1168 } else if (!stricmp(root->name, "a")) { |
1168 } else if (!strcmp(root->name, "a") || !strcmp(root->name, "A")) { |
| 1169 const gchar *href, *link_text; |
1169 const gchar *href, *link_text; |
| 1170 |
1170 |
| 1171 href = xmlnode_get_attrib(root, "href"); |
1171 href = xmlnode_get_attrib(root, "href"); |
| 1172 |
1172 |
| 1173 if (!href) { |
1173 if (!href) { |
| 1199 /* Sorry, kid. MySpace doesn't support you within <a> tags. */ |
1199 /* Sorry, kid. MySpace doesn't support you within <a> tags. */ |
| 1200 xmlnode_free(root->child); |
1200 xmlnode_free(root->child); |
| 1201 root->child = NULL; |
1201 root->child = NULL; |
| 1202 |
1202 |
| 1203 *end = g_strdup(""); |
1203 *end = g_strdup(""); |
| 1204 } else if (!stricmp(root->name, "font")) { |
1204 } else if (!strcmp(root->name, "font") || !strcmp(root->name, "FONT")) { |
| 1205 const gchar *size; |
1205 const gchar *size; |
| 1206 const gchar *face; |
1206 const gchar *face; |
| 1207 |
1207 |
| 1208 size = xmlnode_get_attrib(root, "size"); |
1208 size = xmlnode_get_attrib(root, "size"); |
| 1209 face = xmlnode_get_attrib(root, "face"); |
1209 face = xmlnode_get_attrib(root, "face"); |