diff options
Diffstat (limited to 'app/assets/javascripts/behaviors/markdown/nodes/emoji.js')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/nodes/emoji.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/nodes/emoji.js b/app/assets/javascripts/behaviors/markdown/nodes/emoji.js index 367a06ad3c1..9d0890aa1b4 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/emoji.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/emoji.js @@ -26,6 +26,18 @@ export default class Emoji extends Node { moji: el.textContent, }), }, + { + tag: 'img.emoji', + getAttrs: (el) => { + const name = el.getAttribute('title').replace(/^:|:$/g, ''); + + return { + name, + title: name, + moji: name, + }; + }, + }, ], toDOM: (node) => [ 'gl-emoji', |