Improve alert links accessibility

pull/6000/head
Chocobozzz 2023-10-05 15:20:24 +02:00
parent e5eefaf7a5
commit f85ace9ebb
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 1 deletions

View File

@ -213,8 +213,13 @@ export class AppComponent implements OnInit, AfterViewInit {
error: 'alert-danger'
}
const root = document.createElement('div')
root.innerHTML = await this.markdownService.markdownToUnsafeHTML({ markdown: messageConfig.message })
// Use alert-link class on links since there will be in an alert block
root.querySelectorAll('a').forEach(a => a.className += ' alert-link')
this.broadcastMessage = {
message: await this.markdownService.markdownToUnsafeHTML({ markdown: messageConfig.message }),
message: root.innerHTML,
dismissable: messageConfig.dismissable,
class: classes[messageConfig.level]
}