Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions components/AmbassadorsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ import {
} from '@/components/ui/card';
import { Button } from '@/components/ui/button';

const parseBio = (text: string): string => {
return text
.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>',
)
.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>',
)
.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>',
);
};

interface Contribution {
title: string;
date?: {
Expand Down Expand Up @@ -171,9 +187,10 @@ const AmbassadorCard = ({ ambassador }: { ambassador: Ambassador }) => {
</CardHeader>

{bio && (
<p className='text-gray-700 dark:text-slate-100 text-sm mb-4'>
{bio}
</p>
<p
className='text-gray-700 dark:text-slate-100 text-sm mb-4'
dangerouslySetInnerHTML={{ __html: parseBio(bio as string) }}
/>
)}

{(company || country) && (
Expand Down
Loading