|
1 | 1 | --- |
2 | 2 | import BaseLayout from '../../layouts/BaseLayout.astro'; |
| 3 | +import { marked } from 'marked'; |
3 | 4 | import { |
4 | 5 | communitySlug, |
5 | 6 | contributorHasHallOfFame, |
@@ -42,6 +43,7 @@ const profileDescription = |
42 | 43 | (community as any)?.record?.bio || |
43 | 44 | (community as any)?.record?.description || |
44 | 45 | (community as any)?.record?.funding_statement; |
| 46 | +const profileDescriptionHtml = profileDescription ? marked.parse(profileDescription) : ''; |
45 | 47 | const githubHandle = |
46 | 48 | community?.record && (community as any).type === 'contributor' |
47 | 49 | ? (() => { |
@@ -145,7 +147,11 @@ function formatDate(date: Date | string | undefined): string { |
145 | 147 | </div> |
146 | 148 | { |
147 | 149 | profileDescription ? ( |
148 | | - <p class="text-white/80 text-lg max-w-3xl whitespace-pre-line">{profileDescription}</p> |
| 150 | + <div |
| 151 | + class="profile-description text-lg max-w-3xl" |
| 152 | + data-profile-description |
| 153 | + set:html={profileDescriptionHtml} |
| 154 | + /> |
149 | 155 | ) : ( |
150 | 156 | <p class="text-white/80 text-lg max-w-2xl"> |
151 | 157 | {matchedType |
@@ -389,6 +395,37 @@ function formatDate(date: Date | string | undefined): string { |
389 | 395 | z-index: 1; |
390 | 396 | } |
391 | 397 |
|
| 398 | + .profile-description { |
| 399 | + color: rgb(255 255 255 / 0.8); |
| 400 | + } |
| 401 | + |
| 402 | + .profile-description :global(p) { |
| 403 | + margin: 0.5rem 0; |
| 404 | + } |
| 405 | + |
| 406 | + .profile-description :global(p:first-child) { |
| 407 | + margin-top: 0; |
| 408 | + } |
| 409 | + |
| 410 | + .profile-description :global(p:last-child) { |
| 411 | + margin-bottom: 0; |
| 412 | + } |
| 413 | + |
| 414 | + .profile-description :global(ul), |
| 415 | + .profile-description :global(ol) { |
| 416 | + margin: 0.5rem 0 0.5rem 1.2rem; |
| 417 | + } |
| 418 | + |
| 419 | + .profile-description :global(a) { |
| 420 | + color: var(--color-galaxy-gold); |
| 421 | + text-decoration: underline; |
| 422 | + text-underline-offset: 2px; |
| 423 | + } |
| 424 | + |
| 425 | + .profile-description :global(a:hover) { |
| 426 | + color: #fff; |
| 427 | + } |
| 428 | + |
392 | 429 | .profile-avatar { |
393 | 430 | width: 110px; |
394 | 431 | height: 110px; |
|
0 commit comments