@@ -58,7 +58,14 @@ function getMastodonUsername(url: string): string | null {
5858// Get in/username from LinkedIn URL
5959function getLinkedInUsername(url : string ): string | null {
6060 const match = url .match (/ https? :\/\/ ([^ \/ ] + )\/ in\/ ([^ \/ ] + )(\/ | \? | $ )/ );
61- return match ? ` in/${match [2 ]} ` : null ;
61+ if (match ) {
62+ try {
63+ return ` in/${decodeURIComponent (match [2 ])} ` ;
64+ } catch {
65+ return ` in/${match [2 ]} ` ;
66+ }
67+ }
68+ return null ;
6269}
6370
6471// Get Git hosting service from URL
@@ -85,7 +92,7 @@ function getGitHosting(url: string): string | undefined {
8592 <div class = " flex items-start" >
8693 <div class = " border-4 border-white rounded-lg shadow-lg inline-block mb-10" >
8794 <Image
88- src = { entry .data .avatar }
95+ src = { entry .data .avatar }
8996 alt = { entry .data .name }
9097 height = { 400 }
9198 width = { 600 }
@@ -113,7 +120,7 @@ function getGitHosting(url: string): string | undefined {
113120 {
114121 entry .data .affiliation ||
115122 entry .data .homepage ||
116- entry .data .gitx ||
123+ entry .data .gitx_url ||
117124 entry .data .linkedin_url ||
118125 entry .data .mastodon_url ||
119126 entry .data .twitter_url ? (
@@ -147,22 +154,18 @@ function getGitHosting(url: string): string | undefined {
147154 </>
148155 )}
149156
150- { entry .data .gitx && (
157+ { entry .data .gitx_url && (
151158 <>
152159 <dt class = " font-bold" >
153- { getGitHosting (entry .data .gitx ) ?? " Git" }
160+ { getGitHosting (entry .data .gitx_url ) ?? " Git" }
154161 </dt >
155162 <dd >
156- { isUrl (entry .data .gitx ) ? (
157- <a
158- href = { ensureHttps (entry .data .gitx )}
159- class = " text-primary underline hover:text-primary-hover"
160- >
161- { entry .data .gitx }
162- </a >
163- ) : (
164- <span >{ entry .data .gitx } </span >
165- )}
163+ <a
164+ href = { ensureHttps (entry .data .gitx_url )}
165+ class = " text-primary underline hover:text-primary-hover"
166+ >
167+ { entry .data .gitx_url }
168+ </a >
166169 </dd >
167170 </>
168171 )}
0 commit comments