Add Prism.js.

This commit is contained in:
Florian THIERRY
2024-09-04 09:29:10 +02:00
parent ca6b207816
commit db669114b2
7 changed files with 125 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
import { MatIcon } from '@angular/material/icon';
import { AuthenticationService } from '../../core/service/authentication.service';
declare let Prism: any;
@Component({
selector: 'app-publication',
standalone: true,
@@ -40,6 +42,7 @@ export class PublicationComponent implements OnInit, OnDestroy {
.then(publication => {
this.publication = publication;
this.isAuthorAndUserEquals = this.authenticationService.getAuthenticatedUser()?.id === this.publication.author.id;
setTimeout(() => Prism.highlightAll(), 100);
})
.catch(error => {
this.snackBar.open('An error occurred while loading publication...', 'Close', { duration: 5000 });