Emoticons are now also readable for screen readers

This commit is contained in:
Frank Hochmuth 2024-03-03 18:18:02 +01:00 committed by GitHub
parent 7cea17cc31
commit a00f861075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,13 +19,15 @@ $plugin_emoticons = array(
':heart_eyes:' => '😍',
':sunglasses:' => '😎',
':laughing:' => '😆',
':joy:' => '😂',
':neutral_face:' => '😐',
':flushed:' => '😳',
':hushed:' => '😮',
':dizzy_face:' => '😵',
':cry:' => '😢',
':persevere:' => '😣',
':worried:' => '😟',
':hushed:' => '😮',
':angry:' => '😠',
':mag:' => '🔍',
':hot_beverage:' => '☕',
':exclamation:' => '❗',
@ -54,7 +56,8 @@ function plugin_emoticons_filter ($emostring) {
foreach ($plugin_emoticons as $text => $emoticon) {
$emostring = str_replace(
$text,
$emoticon,
// Is better for screen readers
'<span role="img" aria-label="Emoji ' . htmlentities($text) . '">' . $emoticon . '</span>',
$emostring
);
}