diff --git a/src/app/item-page/clarin-ref-citation/clarin-ref-citation.component.ts b/src/app/item-page/clarin-ref-citation/clarin-ref-citation.component.ts index 6bf5647acb6..c8fcada85eb 100644 --- a/src/app/item-page/clarin-ref-citation/clarin-ref-citation.component.ts +++ b/src/app/item-page/clarin-ref-citation/clarin-ref-citation.component.ts @@ -6,10 +6,6 @@ import { OnInit, ViewChild, } from '@angular/core'; -import { - DomSanitizer, - SafeHtml, -} from '@angular/platform-browser'; import { NgbModal, NgbTooltip, @@ -64,9 +60,9 @@ export class ClarinRefCitationComponent implements OnInit { /** * The content of the reference box, which will be displayed in the tooltip. - * This content is fetched from the RefBox Controller. + * This content is fetched from the RefBox Controller and sanitized by Angular when rendered. */ - refboxContent: BehaviorSubject = new BehaviorSubject(null); + refboxContent: BehaviorSubject = new BehaviorSubject(null); /** * The raw content of the reference box, which is fetched from the RefBox Controller. @@ -84,8 +80,7 @@ export class ClarinRefCitationComponent implements OnInit { private modalService: NgbModal, private requestService: RequestService, protected rdbService: RemoteDataBuildService, - protected halService: HALEndpointService, - private sanitizer: DomSanitizer) { + protected halService: HALEndpointService) { // Configure the tooltip to show on click - `Copied` message config.triggers = 'click'; } @@ -94,7 +89,7 @@ export class ClarinRefCitationComponent implements OnInit { void this.fetchRefBoxContent() .then((content) => { this.refboxCopyContent = content; // Store raw HTML - this.refboxContent.next(this.sanitizer.bypassSecurityTrustHtml(content)); + this.refboxContent.next(content); }).catch((error) => { console.error('Failed to fetch refbox content:', error); this.refboxCopyContent = this.EMPTY_CONTENT;