diff --git a/.changeset/search-hit-description-code.md b/.changeset/search-hit-description-code.md new file mode 100644 index 00000000..15ed3a78 --- /dev/null +++ b/.changeset/search-hit-description-code.md @@ -0,0 +1,5 @@ +--- +'@doc-kit/generator-react': patch +--- + +Render backticks in search result descriptions as inline code diff --git a/packages/react/src/html/ui/components/SearchBox/index.jsx b/packages/react/src/html/ui/components/SearchBox/index.jsx index 311a7f8b..683d44c2 100644 --- a/packages/react/src/html/ui/components/SearchBox/index.jsx +++ b/packages/react/src/html/ui/components/SearchBox/index.jsx @@ -10,6 +10,7 @@ import SearchHit from '@node-core/ui-components/Common/Search/Results/Hit'; import useOrama from '../../hooks/useOrama.mjs'; import withIsland from '../../islands/withIsland.jsx'; import { relativeOrAbsolute } from '../../utils/relativeOrAbsolute.mjs'; +import { renderLabel } from '../../utils/renderLabel.jsx'; import styles from './index.module.css'; /** @@ -62,6 +63,7 @@ const SearchBox = ({ pathname }) => { as={SearchHitLink} document={{ ...hit.document, + description: renderLabel(hit.document.description), href: relativeOrAbsolute(hit.document.href, pathname), }} />