rem: (cfmt.actions.insertChunk) (tPtr, chunk, itAppend);
add: (cfmt.actions.insertChunk) (tPtr, chunk, False);
context: void parseToken(WMText *tPtr, char *token, short tk){	short mode=0; /* 0 starts, 1 closes */	WMScreen	*scr = (W_VIEW(tPtr))->screen;	while(*token && isspace(*(token))) token++;	if(*token == '/') {		token++;		mode = 1;		while(isspace(*(token))) token++;	}	if(strlen(token)==1) {	/* nice and fast for small tokens... no need for too much brain 		power here */		switch(TOLOWER(*token)) {			case 'i': 				if(!mode) {					cfmt.cfont = WMGetFontItalic(scr, cfmt.cfont);					WMPutInBag(cfmt.fonts, (void *)cfmt.cfont);				} else { /*dun wanna remove the baseFont eh? */					int count = WMGetBagItemCount(cfmt.fonts); 					if(count>1) 						WMDeleteFromBag(cfmt.fonts, count-1);			 		cfmt.cfont = (WMFont *)WMGetFromBag(cfmt.fonts,						WMGetBagItemCount(cfmt.fonts)-1); 				} break;			case 'b': 				if(!mode) {					cfmt.cfont = WMGetFontBold(scr, cfmt.cfont);					WMPutInBag(cfmt.fonts, (void *)cfmt.cfont);				} else { /*dun wanna remove the baseFont eh? */					int count = WMGetBagItemCount(cfmt.fonts); 					if(count>1) 						WMDeleteFromBag(cfmt.fonts, count-1);			 		cfmt.cfont = (WMFont *)WMGetFromBag(cfmt.fonts,						WMGetBagItemCount(cfmt.fonts)-1); 				} break;			case 'p': 				cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin, 					WMWidgetWidth(tPtr)-30, NULL, 0, cfmt.align);				(cfmt.actions.insertParagraph) (tPtr, cfmt.para, cfmt.type);				cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin, 					WMWidgetWidth(tPtr)-30, NULL, 0, cfmt.align);				(cfmt.actions.insertParagraph) (tPtr, cfmt.para, cfmt.type);				break;			case 'u': cfmt.u = !mode; break;		}	} else { /* the <HTML> tag is, as far as I'm concerned, useless */		if(mystrcasecmp(token, "br")) {			cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin, 				WMWidgetWidth(tPtr)-30, NULL, 0, cfmt.align);			(cfmt.actions.insertParagraph) (tPtr, cfmt.para, cfmt.type);		}		else if(mystrcasecmp(token, "ul")) {			if(mode) { 				if(cfmt.ul>1) cfmt.ul--;			} else cfmt.ul++;			if(cfmt.ul) {				cfmt.bmargin = cfmt.ul*30;				cfmt.fmargin = cfmt.bmargin-10;			} else cfmt.fmargin = cfmt.bmargin = 0;		} else if(mystrcasecmp(token, "li")) {			cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin, 			WMWidgetWidth(tPtr)-30, NULL, 0, cfmt.align);			(cfmt.actions.insertParagraph) (tPtr, cfmt.para, cfmt.type);		} else if(mystrcasecmp(token, "align"))			;//printf("align");		else if(mystrcasecmp(token, "img"))  {			if(!mode) {				char *mark=NULL;				WMPixmap *pixmap; 				void *chunk;				token+=3;				while(isspace(*(token))) token++;				do { 				switch(TOLOWER(*token)) {				case 's': 						if(TOLOWER(*(1+token)) == 'r' && TOLOWER(*(2+token)) == 'c') {				mark = strchr(token, '='); 				if(mark) {				char img[256], *iptr;				token = mark+1;				if(!token) return;				sscanf(token, "%s", img);				iptr = img;				 if(*img == '\"') { img[strlen(img)-1] = 0; iptr++;}				pixmap = WMCreatePixmapFromFile(scr, iptr);  				chunk = (cfmt.actions.createPChunk)(pixmap, 0, False);				(cfmt.actions.insertChunk) (tPtr, chunk, itAppend);				printf("[%s]\n", iptr);				} } break; } } while(*(token++));			} 			} else if(mystrcasecmp(token, "font")) {#if 0			if(mode) {			 	cfmt.cfont = (WMFont *)WMGetFromBag(cfmt.fonts,						WMGetBagItemCount(cfmt.fonts)-1); 			} else 					(WMColor *)WMGetFromBag(cfmt.colors, 				WMGetBagItemCount(cfmt.colors)-1), #endif			}		else if(mystrcasecmp(token, "center")) {printf("center\n");			if(mode) cfmt.align = WALeft;			else cfmt.align = WACenter;			cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin, 			WMWidgetWidth(tPtr)-30, NULL, 0, cfmt.align);			(cfmt.actions.insertParagraph) (tPtr, cfmt.para, cfmt.type);		}	}			//printf("parse token  (%s)[%s]\n", mode?"close":"open", token); #if 0	i=0;	//while(*token && !isspace(*(token))) token++;//printf("A:%d a:%d z%d Z%d\n", '1', 'a', 'Z', 'z');	do { 		if(!mm) {			if(c>=65 &&  c<=122) { major[i++] = c;			} else if(c==' ' || c=='='){ major[i] = 0; i=0; mm=1; 			printf("\nmajor: [%s]", major);}		} else {			if(c!=' ') {				minor[i++] = c;			} else { minor[i] = 0; i=0; printf("  minor: [%s]  ", minor);}		}	}while((c = *(++token)));#endif			//printf("parse token  (%s)[%s]\n", mode?"close":"open", token); }