public String getHTML(int index) {
		String raw=getString(index);
		if (raw==null) {
			return raw;
		}
		int[] style=getStyle(index);
		if (style==null) {
			return raw;
		}
		StringBuilder html=new StringBuilder(raw.length()+32);
		int offset=0;
		while (true) {
			int i=-1;
			for (int j=0;j!=style.length;j+=3) {
				if (style[j+1]==-1) {
					continue;
				}
				if (i==-1 || style[i+1]>style[j+1]) {
					i=j;
				}
			}
			int start=((i!=-1)?style[i+1]:raw.length());
			for (int j=0;j!=style.length;j+=3) {
				int end=style[j+2];
				if (end==-1 || end>=start) {
					continue;
				}
				if (offset<=end) {
					html.append(raw,offset,end+1);
					offset=end+1;
				}
				style[j+2]=-1;
				html.append('<');
				html.append('/');
				html.append(getString(style[j]));
				html.append('>');
			}
			if (offset<start) {
				html.append(raw,offset,start);
				offset=start;
			}
			if (i==-1) {
				break;
			}
			html.append('<');
			html.append(getString(style[i]));
			html.append('>');
			style[i+1]=-1;
		}
		return html.toString();
	}
Returns string with style tags (html-like).
xpatch/src/main/java/wind/android/content/res/StringBlock.java