Skip to content

Commit bb614f2

Browse files
committed
docs: update link to features
1 parent d260367 commit bb614f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: packages/docs/src/templates/DocsLayout.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ const humanize = (text: string): string => {
6161

6262
const getDescription = (location: Location, description: string) => {
6363
if (location.pathname.includes('api') || location.pathname.includes('styling')) {
64-
const regex = /React\s[A-Z][A-Za-z]*/
64+
const regex = /React\s+(.*?)\s+component/
6565
const parts = description.split(regex)
6666
const matches = description.match(regex)
6767

68+
console.log('parts', parts)
69+
6870
if (matches && parts.length > 1) {
6971
return (
7072
<>
7173
{parts[0]}
72-
<Link to="../">{matches[0]}</Link>
73-
{parts[1]}
74+
<Link to="../">React {parts[1]}</Link> component
75+
{parts[2]}
7476
</>
7577
)
7678
}

0 commit comments

Comments
 (0)