| 1407 char *src_tag; |
1407 char *src_tag; |
| 1408 char *dest_tag; |
1408 char *dest_tag; |
| 1409 gboolean ignore; |
1409 gboolean ignore; |
| 1410 }; |
1410 }; |
| 1411 |
1411 |
| 1412 #define ALLOW_TAG_ALT(x, y) if(!g_ascii_strncasecmp(c, "<" x " ", strlen("<" x " "))) { \ |
1412 #define ALLOW_TAG_ALT(x, y) do { \ |
| |
1413 if(!g_ascii_strncasecmp(c, "<" x " ", strlen("<" x " "))) { \ |
| 1413 const char *o = c + strlen("<" x); \ |
1414 const char *o = c + strlen("<" x); \ |
| 1414 const char *p = NULL, *q = NULL, *r = NULL; \ |
1415 const char *p = NULL, *q = NULL, *r = NULL; \ |
| 1415 GString *innards = g_string_new(""); \ |
1416 GString *innards = g_string_new(""); \ |
| 1416 while(o && *o) { \ |
1417 while(o && *o) { \ |
| 1417 if(!q && (*o == '\"' || *o == '\'') ) { \ |
1418 if(!q && (*o == '\"' || *o == '\'') ) { \ |
| 1478 xhtml = g_string_append(xhtml, "/>");\ |
1479 xhtml = g_string_append(xhtml, "/>");\ |
| 1479 } \ |
1480 } \ |
| 1480 c = strchr(c, '>') + 1; \ |
1481 c = strchr(c, '>') + 1; \ |
| 1481 continue; \ |
1482 continue; \ |
| 1482 } \ |
1483 } \ |
| |
1484 } while (0); |
| 1483 #define ALLOW_TAG(x) ALLOW_TAG_ALT(x, x) |
1485 #define ALLOW_TAG(x) ALLOW_TAG_ALT(x, x) |
| 1484 void |
1486 void |
| 1485 purple_markup_html_to_xhtml(const char *html, char **xhtml_out, |
1487 purple_markup_html_to_xhtml(const char *html, char **xhtml_out, |
| 1486 char **plain_out) |
1488 char **plain_out) |
| 1487 { |
1489 { |