mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 19:29:24 +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;
|
||||
var idx: Integer);
|
||||
begin
|
||||
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
|
||||
if s[idx]=']' then
|
||||
begin
|
||||
Sender.wrtStr(']]]]><![CDATA[>');
|
||||
Inc(idx, 2);
|
||||
// TODO: emit warning 'cdata-section-splitted'
|
||||
end
|
||||
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
|
||||
begin
|
||||
Sender.wrtStr(']]]]><![CDATA[>');
|
||||
Inc(idx, 2);
|
||||
// TODO: emit warning 'cdata-section-splitted'
|
||||
end
|
||||
else
|
||||
Sender.wrtChr(']');
|
||||
end
|
||||
else
|
||||
raise EConvertError.Create('Illegal character');
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user