Skip to content

Commit fbf6135

Browse files
waygeancewaygeance
authored andcommitted
fix: render bio links for Redocly, OpenAPI Initiative, and API Design Matters
1 parent dbfd6ea commit fbf6135

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

components/AmbassadorsCard.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ import {
1010
} from '@/components/ui/card';
1111
import { Button } from '@/components/ui/button';
1212

13+
const parseBio = (text: string): string => {
14+
return text
15+
.replace(
16+
/\bRedocly\b/g,
17+
'<a href="https://github.com/redocly" target="_blank" rel="noopener noreferrer" class="text-blue-600 dark:text-blue-400 hover:underline transition-colors duration-200">Redocly</a>',
18+
)
19+
.replace(
20+
/\bOpenAPI Initiative\b/g,
21+
'<a href="https://github.com/OAI" target="_blank" rel="noopener noreferrer" class="text-blue-600 dark:text-blue-400 hover:underline transition-colors duration-200">OpenAPI Initiative</a>',
22+
)
23+
.replace(
24+
/\bAPI Design Matters\b/g,
25+
'<a href="https://apidesignmatters.substack.com" target="_blank" rel="noopener noreferrer" class="text-blue-600 dark:text-blue-400 hover:underline transition-colors duration-200">API Design Matters</a>',
26+
);
27+
};
28+
1329
interface Contribution {
1430
title: string;
1531
date?: {
@@ -171,9 +187,10 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
171187
</CardHeader>
172188

173189
{bio && (
174-
<p className='text-gray-700 dark:text-slate-100 text-sm mb-4'>
175-
{bio}
176-
</p>
190+
<p
191+
className='text-gray-700 dark:text-slate-100 text-sm mb-4'
192+
dangerouslySetInnerHTML={{ __html: parseBio(bio as string) }}
193+
/>
177194
)}
178195

179196
{(company || country) && (

0 commit comments

Comments
 (0)