- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
function ReplaceHTMLSpec(First, Last, RepTo, RepEd:string):string;
var
I, P, St:Integer;
SS, Temp:string;
begin
Temp:='';
ST:=0;
while True do
begin
P:=Pos(First, Result);
if P = 0 then Break;
SS:=Copy(Result, ST, P-1)+RepTo;
Temp:=Temp+SS;
ST:=P+Length(First);
Result:=Copy(Result, ST, MaxInt);
P:=Pos(Last, Result);
if P > 0 then
begin
SS:=Copy(Result, 1, P-1)+RepEd;
Temp:=Temp+SS;
ST:=P+Length(Last);
SS:=Copy(Result,ST, MaxInt);
Temp:=Temp+SS;
end;
Result:=Temp;
end;
end;
function DecorateText(S:string):string;
const
Arr:array[0..3] of string=('<br>','"','<','>');
var
I, P, St:Integer;
SS, Temp:string;
begin
Result:=S;
for I:=0 to 3 do
Result:=StringReplace(Result, Arr[I], '',[rfreplaceall]);
Result:=StringReplace(Result,'<br />',#13#10,[rfreplaceall]);
Result:=StringReplace(Result,'<i>','[i]',[rfreplaceall]);
Result:=StringReplace(Result,'</i>','[/i]',[rfreplaceall]);
Result:=StringReplace(Result,'<b>','[b]',[rfreplaceall]);
Result:=StringReplace(Result,'</b>','[/b]',[rfreplaceall]);
Temp:='';
ST:=0;
{ while True do
begin
P:=Pos('<span style="font-size:10px;">', Result);
if P = 0 then Break;
SS:=Copy(Result, ST, P-1)+'[size=10]';
Temp:=Temp+SS;
ST:=P+Length('<span style="font-size:10px;">');
Result:=Copy(Result, ST, MaxInt);
P:=Pos('</span>', Result);
if P > 0 then
begin
SS:=Copy(Result, 1, P-1)+'[/size]';
Temp:=Temp+SS;
ST:=P+Length('</span>');
SS:=Copy(Result,ST, MaxInt);
Temp:=Temp+SS;
Result:=Temp;
end;
end; }
Result:=ReplaceHTMLSpec('<span style="color:white;">','</span>','[color=white]','[/color]');
Result:=ReplaceHTMLSpec('<span style="color:red;">','</span>','[color=red]','[/color]');
Result:=ReplaceHTMLSpec('<span style="color:blue;">','</span>','[color=blue]','[/color]');
Result:=ReplaceHTMLSpec('<span style="color:green;">','</span>','[color=green]','[/color]');
Result:=ReplaceHTMLSpec('<pre><code class="">','</code></pre>','[code]','[/code]');
Result:=ReplaceHTMLSpec('<span style="font-size:10px;">','</span>','[size=10]','[/size]');
Result:=ReplaceHTMLSpec('<span style="font-size:15px;">','</span>','[size=15]','[/size]');
Result:=ReplaceHTMLSpec('<span style="font-size:20px;">','</span>','[size=20]','[/size]');
Result:=ReplaceHTMLSpec('<span style="text-decoration:underline;">','</span>','[u]','[/u]');
Result:=ReplaceHTMLSpec('<span style="text-decoration:line-through;">','</span>','[s]','[/s]');
Result:=ReplaceHTMLSpec('<span style="text-decoration:blink;">','</span>','[blink]','[/blink]');
end;
Пахнет селёдкой. Ой блять, забыл подмыться.