mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
60ff9a9c79
commit
5173b28b5a
@@ -134,4 +134,16 @@ export class MetadataValuesComponent implements OnChanges {
|
||||
hasInternalLink(linkValue: string): boolean {
|
||||
return linkValue.startsWith(environment.ui.baseUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method performs a validation and determines the target of the url.
|
||||
* @returns - Returns the target url.
|
||||
*/
|
||||
getLinkAttributes(urlValue: string): { target: string, rel: string } {
|
||||
if (this.hasInternalLink(urlValue)) {
|
||||
return { target: '_self', rel: '' };
|
||||
} else {
|
||||
return { target: '_blank', rel: 'noopener noreferrer' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user