EntityNormalizer: Add colons to emoji alt text.

This makes it possible to copy them and still have them work.
This commit is contained in:
lain 2020-06-04 15:12:03 +02:00
parent 5ac2c365a7
commit f197a2aa39

View file

@ -210,7 +210,7 @@ export const addEmojis = (string, emojis) => {
const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\$&')
return acc.replace(
new RegExp(`:${regexSafeShortCode}:`, 'g'),
`<img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' />`
`<img src='${emoji.url}' alt=':${emoji.shortcode}:' title=':${emoji.shortcode}:' class='emoji' />`
)
}, string)
}