#include #include int main() { char * str; str=(char *)malloc(sizeof(char)*9999); { char *str_replace(char *orig, char *rep, char *str) { static char buffer[4096]; char *p; if(! (p = strstr(str, orig))) return str; strncpy(buffer, str, p - str); buffer[p - str] = '\0'; sprintf(buffer + (p - str), "%s%s", rep, p + strlen(orig)); return buffer; } printf("Enter html text: "); scanf("%s", str); // for correct work str = str_replace("", "-->", str); str = str_replace("", "-->", str); str = str_replace("", "", str); // tags changing str = str_replace("", "/center>", str); str = str_replace("", "/i>", str); str = str_replace("", "/header>
", str); str = str_replace("", "/font>", str); str = str_replace("Show all datails ", "/condition>", str); str = str_replace("", "/pre>", str); str = str_replace("", "/pre>", str); // span inline style converter str = str_replace("font-weight: bold;", "><", str); str = str_replace("font-style: italic;", "><", str); str = str_replace("text-decoration: underline;", "><", str); str = str_replace("text-decoration: line-through;", "><", str); str = str_replace("font-weight:bold;", "><", str); str = str_replace("font-style:italic;", "><", str); str = str_replace("text-decoration:underline;", "><", str); str = str_replace("text-decoration:line-through;", "><", str); str = str_replace("/span>", "/b>", str); printf("%s", str); } free(str); }