Repository: facebook/react
File: packages/react-devtools-shared/src/devtools/views/Components/InspectedElement.js (JavaScript)

Code before:
      const rendererID = store.getRendererIDForElement(
        nearestSuspenseElementID,
      );

      // Toggle suspended
      if (rendererID !== null) {
        bridge.send('overrideSuspense', {
          id: nearestSuspenseElementID,
          rendererID,
          forceFallback: !isSuspended,
        });
      }
    }
  }, [bridge, dispatch, element, isSuspended, modalDialogDispatch, store]);

  const onOpenInEditor = useCallback(() => {
    const source = inspectedElement?.source;
    if (source == null || editorURL == null) {
      return;
    }

    const url = new URL(editorURL);
    url.href = url.href.replace('{path}', source.fileName);
    url.href = url.href.replace('{line}', String(source.lineNumber));
    url.href = url.href.replace('%7Bpath%7D', source.fileName);
    url.href = url.href.replace('%7Bline%7D', String(source.lineNumber));
    window.open(url);
  }, [inspectedElement, editorURL]);

  if (element === null) {
    return (
      <div className={styles.InspectedElement}>
        <div className={styles.TitleRow} />
      </div>
    );
  }

  let strictModeBadge = null;
  if (element.isStrictModeNonCompliant) {
    strictModeBadge = (
      <a
        className={styles.StrictModeNonCompliant}
        href="https://react.dev/reference/react/StrictMode"
        rel="noopener noreferrer"
        target="_blank"
        title="This component is not running in StrictMode. Click to learn more.">
        <Icon type="strict-mode-non-compliant" />
      </a>
    );
  }


Review comment (suggestion):
```suggestion
    url.href = url.href
        .replace('{path}', source.fileName)
        .replace('{line}', String(source.lineNumber))
        .replace('%7Bpath%7D', source.fileName)
        .replace('%7Bline%7D', String(source.lineNumber));
```

Code after:
      const rendererID = store.getRendererIDForElement(
        nearestSuspenseElementID,
      );

      // Toggle suspended
      if (rendererID !== null) {
        bridge.send('overrideSuspense', {
          id: nearestSuspenseElementID,
          rendererID,
          forceFallback: !isSuspended,
        });
      }
    }
  }, [bridge, dispatch, element, isSuspended, modalDialogDispatch, store]);

  const onOpenInEditor = useCallback(() => {
    const source = inspectedElement?.source;
    if (source == null || editorURL == null) {
      return;
    }

    const url = new URL(editorURL);
    url.href = url.href
      .replace('{path}', source.fileName)
      .replace('{line}', String(source.lineNumber))
      .replace('%7Bpath%7D', source.fileName)
      .replace('%7Bline%7D', String(source.lineNumber));
    window.open(url);
  }, [inspectedElement, editorURL]);

  if (element === null) {
    return (
      <div className={styles.InspectedElement}>
        <div className={styles.TitleRow} />
      </div>
    );
  }

  let strictModeBadge = null;
  if (element.isStrictModeNonCompliant) {
    strictModeBadge = (
      <a
        className={styles.StrictModeNonCompliant}
        href="https://react.dev/reference/react/StrictMode"
        rel="noopener noreferrer"
        target="_blank"
        title="This component is not running in StrictMode. Click to learn more.">
        <Icon type="strict-mode-non-compliant" />
      </a>
    );
  }