anchor.diff:      obj.InputString:= AText;
       if obj.ExecPos(1) then
       repeat
  +      bClosing:= obj.Match[1]<>'';
  +      sTag:= obj.Match[2];
  +
  +      if not AllowSingletonTags then
  +        if not IsTagNeedsClosingTag(sTag) then Continue;
  +
         SetLength(ARes, Length(ARes)+1);
  -      ARes[High(ARes)].bClosing:= obj.Match[1]<>'';
  -      ARes[High(ARes)].sTagName:= obj.Match[2];
  +      ARes[High(ARes)].bClosing:= bClosing;
  +      ARes[High(ARes)].sTagName:= sTag;
       until not obj.ExecNext;
     finally
       obj.Free;
  
positive.code:   i, j: integer;
  begin
    Result:= '';
    EditorFindHtmlTagsInText(AText, tags);
  
    //delete pairs <tag> - </tag>
    for i:= High(tags) downto 0 do
    begin
      if not tags[i].bClosing then
      begin
        if not IsTagNeedsClosingTag(tags[i].sTagName) then
        begin
          Delete(tags, i, 1);
          Continue;
        end;
  
        for j:= i+1 to High(tags) do
          if tags[j].bClosing and SameText(tags[i].sTagName, tags[j].sTagName) then
          begin
  
negative.code:           Delete(tags, i, 1);
            Break;
          end;
    end;
  
    //take last opened tag
  