Skip to content

Commit 868f848

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

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

components/AmbassadorsCard.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ 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(/\bRedocly\b/g, '<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>')
16+
.replace(/\bOpenAPI Initiative\b/g, '<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>')
17+
.replace(/\bAPI Design Matters\b/g, '<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>')
18+
};
19+
1320
interface Contribution {
1421
title: string;
1522
date?: {
@@ -171,9 +178,10 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
171178
</CardHeader>
172179

173180
{bio && (
174-
<p className='text-gray-700 dark:text-slate-100 text-sm mb-4'>
175-
{bio}
176-
</p>
181+
<p
182+
className='text-gray-700 dark:text-slate-100 text-sm mb-4'
183+
dangerouslySetInnerHTML={{ __html: parseBio(bio as string) }}
184+
/>
177185
)}
178186

179187
{(company || country) && (

0 commit comments

Comments
 (0)