@@ -388,7 +388,7 @@ function renderPersonalInfoFromJson(recordJson, container) {
388388
389389 const countries = jsonList ( person ?. addresses ?. address )
390390 . map ( ( a ) => {
391- return jsonText ( a ?. country )
391+ return localizedCountryName ( jsonText ( a ?. country ) )
392392 } )
393393 . filter ( Boolean )
394394
@@ -445,9 +445,10 @@ function otherIdsTextNode(label, value, url) {
445445 wrapper . appendChild ( prefix )
446446 }
447447
448+ const safeUrl = sanitizeUrl ( url )
448449 const valueAsUrl = sanitizeUrl ( value )
449- if ( valueAsUrl ) {
450- // If the value itself is a URL, render it as a link and ignore the `url` parameter
450+ if ( safeUrl && valueAsUrl ) {
451+ // If both are provided and value is a URL, render value as the link
451452 wrapper . appendChild ( document . createTextNode ( ' (' ) )
452453 const a = document . createElement ( 'a' )
453454 a . href = valueAsUrl
@@ -457,10 +458,10 @@ function otherIdsTextNode(label, value, url) {
457458 wrapper . appendChild ( a )
458459 wrapper . appendChild ( document . createTextNode ( ')' ) )
459460 } else {
460- // Otherwise, keep the existing behavior: render value as text,
461+ // Otherwise, render value as text,
462+ if ( value ) wrapper . appendChild ( document . createTextNode ( value ) )
463+
461464 // and optionally append a (url) link if provided and safe
462- wrapper . appendChild ( document . createTextNode ( value ) )
463- const safeUrl = sanitizeUrl ( url )
464465 if ( safeUrl ) {
465466 wrapper . appendChild ( document . createTextNode ( ' (' ) )
466467 const a = document . createElement ( 'a' )
@@ -574,9 +575,7 @@ function composeActivityEntryFromJson(entry, opts = {}) {
574575 idRel && idRel . toLowerCase ( ) !== 'self'
575576 ? `${ localizedRel } ${ idType } ` . trim ( )
576577 : idType || STRINGS . identifier
577- wrapper . appendChild (
578- otherIdsTextNode ( label , idValue || idUrl || '' , idUrl )
579- )
578+ wrapper . appendChild ( otherIdsTextNode ( label , idValue , idUrl ) )
580579 } )
581580 }
582581
0 commit comments