|
@@ -553,16 +553,17 @@ begin
|
|
AutoClose(TagName);
|
|
AutoClose(TagName);
|
|
namePush(TagName);
|
|
namePush(TagName);
|
|
DoStartElement('', TagName, '', Attr);
|
|
DoStartElement('', TagName, '', Attr);
|
|
- if not (efSubelementContent in HTMLElementProps[FStack[FNesting-1]].Flags) then begin
|
|
|
|
- DoEndElement('', TagName, '');
|
|
|
|
- NamePop;
|
|
|
|
- end;
|
|
|
|
if FStack[FNesting-1] in [etScript,etStyle] then
|
|
if FStack[FNesting-1] in [etScript,etStyle] then
|
|
begin
|
|
begin
|
|
NewContext := scScript;
|
|
NewContext := scScript;
|
|
FScriptEndTag := '</' + HTMLElementProps[FStack[FNesting-1]].Name;
|
|
FScriptEndTag := '</' + HTMLElementProps[FStack[FNesting-1]].Name;
|
|
FScriptEndMatchPos := 1;
|
|
FScriptEndMatchPos := 1;
|
|
end;
|
|
end;
|
|
|
|
+ if (efSubcontent*HTMLElementProps[FStack[FNesting-1]].Flags=[]) then begin
|
|
|
|
+ // do not push empty elements, don't wait for AutoClose
|
|
|
|
+ DoEndElement('', TagName, '');
|
|
|
|
+ NamePop;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
if Assigned(Attr) then
|
|
if Assigned(Attr) then
|
|
Attr.Free;
|
|
Attr.Free;
|
|
@@ -574,8 +575,8 @@ begin
|
|
scScript:
|
|
scScript:
|
|
begin
|
|
begin
|
|
DoCharacters(PSAXChar(TokenText), 0, Length(TokenText));
|
|
DoCharacters(PSAXChar(TokenText), 0, Length(TokenText));
|
|
- DoEndElement('', HTMLElementProps[FStack[FNesting-1]].Name, '');
|
|
|
|
- namePop;
|
|
|
|
|
|
+ DoEndElement('', Copy(FScriptEndTag, 3), '');
|
|
|
|
+ NamePop;
|
|
FScriptEndTag := '';
|
|
FScriptEndTag := '';
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|