This is a narrowly maintained source fork of @docsearch/react 5.2.0, released
locally as 5.2.0-phcode.2. The application consumes the package in releases/;
it does not rewrite installed dependencies or modify DocSearch's DOM at runtime.
- Repository: https://github.com/algolia/docsearch
- Revision:
db3337978a2c9be6ec9187e73105a94dc0b1bbf3 - Original package: https://www.npmjs.com/package/@docsearch/react/v/5.2.0
- Original package integrity:
sha512-ZJrYePS2+UK7M3X5xWmKsm8VJ0GuslnAk8jcIcjPfd20GoCEjce9e+3X/8UH0lAtWokesAm2ERUJzlwr/9YCpg== - License: MIT, preserved from upstream.
src/ and style/ contain the package's production source. Unrelated upstream
tests, screenshots, examples, and monorepo packages are omitted. The original
SHA-256 for each imported file is recorded in upstream-files.json.
The reviewed source differences are recorded in upstream.patch:
- Preserve encoded URLs.
src/utils/sanitize.tsretains upstream's scheme validation, including decoding used to detect unsafe schemes, but returns the original validated URL. Previously, an absolute URL containingPro%20FeaturesbecameProFeatures; encoded query values and fragments could also change. The existing HTML escaping and unsafe-scheme rejection remain in place. - Name the Sidepanel dialog.
src/Sidepanel/Sidepanel.tsxcreates a unique heading ID withReact.useId(), connects it witharia-labelledby, and passes the already supported header translations through toSidepanelHeader.tsx. The heading stays visible and gives the dialog its accessible name. - Render linked screenshots.
src/utils/markdown.tsrenders a link's child tokens through the existing safe Markdown renderers. Previously, a screenshot wrapped in a link appeared as literal Markdown. Image and link URLs still pass through the sanitizer; embedded HTML and attribute values remain escaped. - Identify the maintained build.
src/version.tsreports5.2.0-phcode.2.
The build configuration only relocates upstream's shared configuration into this directory. It preserves the public exports, ESM and UMD outputs, CSS entry points, and ES2017 browser target. Development dependencies are locked locally; no new build tool is required by the application's normal installation.
Use Node.js 24 and npm 11, matching the tested build environment. Run from this directory:
npm ci --ignore-scripts
npm run build
npm test
npm pack --pack-destination releases --ignore-scriptsThe JavaScript tests execute the sanitizer source through the TypeScript compiler, retain upstream's unsafe-scheme fixtures, test URL preservation, render the built Sidepanel to verify its accessible name, and check that every other production source file still matches its upstream hash. Shared JavaScript cases cover linked and standalone images, formatted labels, encoded URLs, unsafe nested URLs, HTML and attribute injection, and partially streamed Markdown against both source and the installed compiled package. No test sends an AI request.
Commit source changes and the rebuilt tarball together. Update the application
lockfile so its integrity covers the new package. Do not run npm publish for this
private package. Do not edit dist/, the tarball, or installed node_modules.
The application's root dependency and npm override must both resolve to this same
artifact; check npm ls @docsearch/react to ensure that the Docusaurus adapter,
modal, and sidepanel integrations share the corrected package.
Before upgrading, check upstream for fixes to the URL sanitizer, the Sidepanel accessible name, and linked-image rendering. Run the same regression cases against the candidate release and verify full-page Ask AI submission, encoded citation/source links, mobile layout, and keyboard close/focus behavior. Once an official release passes, replace the file dependency with that release, remove the override, and remove this directory.
Checked on 18 November 2026: the live npm registry and official release notes still list DocSearch 5.2.0 and Docusaurus 3.10.2 as latest stable. The upstream Markdown renderer still escapes the raw link label instead of rendering its child tokens. Keep the three fixes until upstream passes all regression cases.
Relevant upstream implementation and documentation: