FIX: Add `alt` and `title` attribute to emoji widget.

This commit is contained in:
Guo Xiang Tan 2016-11-16 10:47:29 +08:00
parent b5dc68cd52
commit 64b5c81843
2 changed files with 1 additions and 6 deletions

View File

@ -93,11 +93,6 @@ class PluginApi {
if (result.icon) {
iconBody = iconNode(result.icon);
} else if (result.emoji) {
iconBody = result.emoji.split('|').map(emoji => {
const src = emojiUrlFor(emoji);
return dec.h('img', { className: 'emoji', attributes: { src } });
});
iconBody = result.emoji.split('|').map(name => dec.attach('emoji', { name }));
}

View File

@ -11,6 +11,6 @@ export default createWidget('emoji', {
tagName: 'img.emoji',
buildAttributes(attrs) {
return { src: emojiUrlFor(attrs.name) };
return { src: emojiUrlFor(attrs.name), title: attrs.name, alt: `:${attrs.name}:` };
},
});