@diplodoc/client 5.2.2 → 5.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3489,7 +3489,7 @@ function useProvider(provider) {
3489
3489
  cache.set(query, items2);
3490
3490
  setTimeout(() => cache.delete(query), 3e4);
3491
3491
  return items2;
3492
- } catch (error) {
3492
+ } catch (e) {
3493
3493
  return [
3494
3494
  {
3495
3495
  type: SuggestItemType.Text,
@@ -4145,7 +4145,8 @@ var TocItemRegistry = class {
4145
4145
  items.forEach((item) => {
4146
4146
  this.itemById.set(item.id, item);
4147
4147
  if (item.href) {
4148
- const [pathname, hash] = item.href.split("#");
4148
+ const [leftPart, hash] = item.href.split("#");
4149
+ const [pathname] = leftPart.split("?");
4149
4150
  const url = this.normalizeUrl(pathname, hash);
4150
4151
  if (url) {
4151
4152
  this.itemIdByUrl.set(url, item.id);
@@ -4337,7 +4338,7 @@ var Toc = class extends react.Component {
4337
4338
  if (prevProps.items !== items) {
4338
4339
  nextState = this.getInitialState();
4339
4340
  }
4340
- if (prevProps.router.pathname !== router.pathname || prevProps.router.hash !== router.hash || prevProps.singlePage !== singlePage) {
4341
+ if (prevProps.router.pathname !== router.pathname || prevProps.router.hash !== router.hash || prevProps.singlePage !== singlePage || nextState) {
4341
4342
  nextState = this.computeState(nextState || prevState);
4342
4343
  } else if (prevState.activeId !== this.state.activeId) {
4343
4344
  this.scrollToActiveItem();
@@ -12369,7 +12370,7 @@ var DocPage_default = withHighlightedSearchWords_default(DocPage);
12369
12370
 
12370
12371
  function normalizePath(path) {
12371
12372
  if (!path) return path;
12372
- return path.replace(/^\//, "").replace(/\.html$/, "").replace(/\/index$/, "/");
12373
+ return path.replace(/^\//, "").replace(/\.html(\?.*)?$/, "$1").replace(/\/index(\?.*)?$/, "/$1");
12373
12374
  }
12374
12375
  function normalizeHash(hash) {
12375
12376
  if (hash && hash.startsWith("#")) {