anchor.diff:  
     procedure NextCh;
     begin
  -    SetLength(Collect, Length(Collect) + 1);
  -    Collect[Length(Collect)] := LCh;
  +    htAppendChr(Collect, LCh);
       GetCh;
     end;
   
  
positive.code:         else
            Result := Collect;
        end
        else
          Result := Collect;
      end; {case}
  
negative.code:   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.}
  
  