anchor.diff:    end;
   end;
   
  +//-- BG ---------------------------------------------------------- 04.02.2015 --
  +function TryShorterEntity(Entity: ThtString; out I: Integer; var Collect: ThtString): Boolean;
  +var
  +  J: Integer;
  +begin
  +  J := Entity.Length;
  +  while J > 2 do
  +  begin
  +    SetLength(Entity, J - 1);
  +    if Entities.Find(Entity, I) then
  +    begin
  +      I := PEntity(Entities.Objects[I]).Value;
  +      Collect := Copy(Collect, J + 1, MaxInt);
  +      Result := True;
  +      Exit;
  +    end;
  +    Dec(J);
  +  end;
  +  Result := False;
  +end;
  +
   function THtmlParser.GetEntityStr(CodePage: Integer): ThtString;
   {read an entity and return it as a ThtString.}
   
  
positive.code:         else
            Result := Collect;
        end
        else
          Result := Collect;
      end; {case}
  
negative.code: 
    procedure NextCh;
    begin
      htAppendChr(Collect, LCh);
      GetCh;
    end;
  
  