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
2929 CR = #13 ; // carriage return character
3030 SUB = #26 ; // ASCII SUB character
3131 ESC = #27 ; // escape character
32+
3233 SINGLEQUOTE = ' '' ' ; // single quote character
3334 DOUBLEQUOTE = ' "' ; // double quote character
35+ AMPERSAND = ' &' ; // ampersand character
36+ GT = ' >' ; // greater-than / closing angle bracket character
37+ LT = ' <' ; // less-than / opening angle bracket character
3438
3539 CRLF = CR + LF; // carriage return followed by line feed
3640 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;
227227 for Ch in Text do
228228 begin
229229 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);
242236 end ;
243237 end ;
244238 Result := SB.ToString;
You can’t perform that action at this time.
0 commit comments