Subversion Repositories Kolibri OS

Rev

Rev 7937 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7937 Rev 7945
Line 36... Line 36...
36
	int cur_encoding, custom_encoding;
36
	int cur_encoding, custom_encoding;
37
	bool link, t_html, t_body;
37
	bool link, t_html, t_body;
38
	dword link_bg;
38
	dword link_bg;
39
	dword bufpointer;
39
	dword bufpointer;
40
	dword bufsize;
40
	dword bufsize;
-
 
41
	dword is_html;
Line 41... Line 42...
41
 
42
 
42
	void Paint();
43
	void Paint();
43
	void SetPageDefaults();
44
	void SetPageDefaults();
44
	void AddCharToTheLine();
45
	void AddCharToTheLine();
Line 171... Line 172...
171
		memmov(bufpointer, _bufpointer, bufsize);
172
		memmov(bufpointer, _bufpointer, bufsize);
172
	} else {
173
	} else {
173
		custom_encoding = CH_CP866;	
174
		custom_encoding = CH_CP866;	
174
	}
175
	}
175
	SetPageDefaults();
176
	SetPageDefaults();
-
 
177
	is_html = true;
176
	if (strstri(bufpointer, "
178
	if (!strstri(bufpointer, "
177
		t_body = true;
179
		t_body = true;
-
 
180
		if (!strstri(bufpointer, "
178
		if (strstri(bufpointer, "
181
			style.pre = true; //show linebreaks for a plaint text
-
 
182
			is_html = false;
-
 
183
		}
179
	} 
184
	} 
180
	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
185
	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
181
	{
186
	{
182
		bukva = ESBYTE[bufpos];
187
		bukva = ESBYTE[bufpos];
183
		switch (bukva)
188
		switch (bukva)
Line 211... Line 216...
211
			} else {
216
			} else {
212
				AddCharToTheLine('&');
217
				AddCharToTheLine('&');
213
			}
218
			}
214
			break;
219
			break;
215
		case '<':
220
		case '<':
-
 
221
			if (!is_html) goto _default;
216
			bufpos++;
222
			bufpos++;
217
			if (!strncmp(bufpos,"!--",3))
223
			if (!strncmp(bufpos,"!--",3))
218
			{
224
			{
219
				bufpos+=3;
225
				bufpos+=3;
220
				while (strncmp(bufpos,"-->",3)!=0) && (bufpos < bufpointer + bufsize)
226
				while (strncmp(bufpos,"-->",3)!=0) && (bufpos < bufpointer + bufsize)
Line 250... Line 256...
250
			strlwr(#tag.name);
256
			strlwr(#tag.name);
Line 251... Line 257...
251
 
257
 
252
			// ignore text inside the next tags
258
			// ignore text inside the next tags
253
			if (tag.is("script")) || (tag.is("style")) || (tag.is("binary")) || (tag.is("select"))  { 
259
			if (tag.is("script")) || (tag.is("style")) || (tag.is("binary")) || (tag.is("select"))  { 
254
				sprintf(#tag.params, "", #tag.name);
260
				sprintf(#tag.params, "", #tag.name);
255
				j = strstri(bufpos, #tag.params);
-
 
256
				if (j!=-1) bufpos = j-1;
261
				if (j = strstri(bufpos, #tag.params)) bufpos = j-1;
257
				break;
262
				break;
Line 258... Line 263...
258
			}
263
			}
259
 
264
 
Line 265... Line 270...
265
				Paint();
270
				Paint();
266
				if (tag.name) SetStyle();
271
				if (tag.name) SetStyle();
267
			}
272
			}
268
			break;
273
			break;
269
		default:
274
		default:
-
 
275
			_default:
270
			AddCharToTheLine(ESBYTE[bufpos]);
276
			AddCharToTheLine(ESBYTE[bufpos]);
271
		}
277
		}
272
	}
278
	}
273
	Paint();
279
	Paint();
274
	NewLine();
280
	NewLine();