mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
* Handle xml/xhtml style empty tags by emitting a pair of StartElement/EndElement events with
correct tag name. Slightly modified patch from Marco van de Voort, resolves #13409. git-svn-id: trunk@13047 -
This commit is contained in:
parent
b02aededf8
commit
b9ad8e3755
@ -380,11 +380,20 @@ begin
|
||||
if Length(TokenText) > 0 then
|
||||
begin
|
||||
Attr := nil;
|
||||
if TokenText[1] = '/' then
|
||||
if TokenText[Length(fTokenText)]='/' then // handle xml/xhtml style empty tag
|
||||
begin
|
||||
setlength(fTokenText,length(fTokenText)-1);
|
||||
// Do NOT combine to a single line, as Attr is an output value!
|
||||
TagName := SplitTagString(TokenText, Attr);
|
||||
DoStartElement('', TagName, '', Attr);
|
||||
DoEndElement('', TagName, '');
|
||||
end
|
||||
else if TokenText[1] = '/' then
|
||||
begin
|
||||
DoEndElement('',
|
||||
SplitTagString(Copy(TokenText, 2, Length(TokenText)), Attr), '');
|
||||
end else if TokenText[1] <> '!' then
|
||||
end
|
||||
else if TokenText[1] <> '!' then
|
||||
begin
|
||||
// Do NOT combine to a single line, as Attr is an output value!
|
||||
TagName := SplitTagString(TokenText, Attr);
|
||||
|
Loading…
Reference in New Issue
Block a user