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