File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ interface
29
29
CR = #13 ; // carriage return character
30
30
SUB = #26 ; // ASCII SUB character
31
31
ESC = #27 ; // escape character
32
+
32
33
SINGLEQUOTE = ' '' ' ; // single quote character
33
34
DOUBLEQUOTE = ' "' ; // double quote character
35
+ AMPERSAND = ' &' ; // ampersand character
36
+ GT = ' >' ; // greater-than / closing angle bracket character
37
+ LT = ' <' ; // less-than / opening angle bracket character
34
38
35
39
CRLF = CR + LF; // carriage return followed by line feed
36
40
EOL = CRLF; // end of line character sequence for Windows systems
Original file line number Diff line number Diff line change @@ -227,18 +227,12 @@ class function THTML.Entities(const Text: string): string;
227
227
for Ch in Text do
228
228
begin
229
229
case Ch of
230
- ' <' :
231
- SB.Append(' <' );
232
- ' >' :
233
- SB.Append(' >' );
234
- ' &' :
235
- SB.Append(' &' );
236
- DOUBLEQUOTE:
237
- SB.Append(' "' );
238
- #0 ..#9 , #11 , #12 , #14 ..#31 :
239
- SB.Append(' &#' + IntToStr(Ord(Ch)) + ' ;' )
240
- else
241
- SB.Append(Ch);
230
+ LT: SB.Append(' <' );
231
+ GT: SB.Append(' >' );
232
+ SINGLEQUOTE: SB.Append(' '' );
233
+ DOUBLEQUOTE: SB.Append(' "' );
234
+ AMPERSAND: SB.Append(' &' );
235
+ else SB.Append(Ch);
242
236
end ;
243
237
end ;
244
238
Result := SB.ToString;
You can’t perform that action at this time.
0 commit comments