Make title attribute on emoji widget optional.
This commit is contained in:
parent
00c0410fc7
commit
3f54730c2d
|
@ -92,7 +92,11 @@ class PluginApi {
|
|||
if (result.icon) {
|
||||
iconBody = iconNode(result.icon);
|
||||
} else if (result.emoji) {
|
||||
iconBody = result.emoji.split('|').map(name => dec.attach('emoji', { name }));
|
||||
iconBody = result.emoji.split('|').map(name => {
|
||||
let widgetAttrs = { name };
|
||||
if (result.title) widgetAttrs.title = true;
|
||||
dec.attach('emoji', widgetAttrs);
|
||||
});
|
||||
}
|
||||
|
||||
if (result.text) {
|
||||
|
|
|
@ -11,6 +11,8 @@ export default createWidget('emoji', {
|
|||
tagName: 'img.emoji',
|
||||
|
||||
buildAttributes(attrs) {
|
||||
return { src: emojiUrlFor(attrs.name), title: attrs.name, alt: `:${attrs.name}:` };
|
||||
let result = { src: emojiUrlFor(attrs.name), alt: `:${attrs.name}:` };
|
||||
if (attrs.title) result.title = attrs.name;
|
||||
return result;
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue