mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 00:59:08 +02:00
* Fixed handling of ']' character in CDATA sections, when it is not starting a ']]>' delimiter it must be output as-is. Mantis #23794.
git-svn-id: trunk@23551 -
This commit is contained in:
parent
7e79042d58
commit
f5a8f69517
@ -384,12 +384,17 @@ end;
|
|||||||
procedure CDSectSpecialCharCallback(Sender: TXMLWriter; const s: DOMString;
|
procedure CDSectSpecialCharCallback(Sender: TXMLWriter; const s: DOMString;
|
||||||
var idx: Integer);
|
var idx: Integer);
|
||||||
begin
|
begin
|
||||||
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
|
if s[idx]=']' then
|
||||||
begin
|
begin
|
||||||
Sender.wrtStr(']]]]><![CDATA[>');
|
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
|
||||||
Inc(idx, 2);
|
begin
|
||||||
// TODO: emit warning 'cdata-section-splitted'
|
Sender.wrtStr(']]]]><![CDATA[>');
|
||||||
end
|
Inc(idx, 2);
|
||||||
|
// TODO: emit warning 'cdata-section-splitted'
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Sender.wrtChr(']');
|
||||||
|
end
|
||||||
else
|
else
|
||||||
raise EConvertError.Create('Illegal character');
|
raise EConvertError.Create('Illegal character');
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user