diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-14 00:09:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-14 00:09:56 +0300 |
commit | 85770eb3a25c9d9183ca7fce72d4d74c1552a53f (patch) | |
tree | ec0ef8354ad568e72f3a6ecac140af6ba39e729f /app/assets/javascripts/behaviors | |
parent | cb6a3f5f73097b995d8465c2472ceeab9bbe9497 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/nodes/emoji.js | 12 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/nodes/image.js | 2 |
2 files changed, 13 insertions, 1 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', diff --git a/app/assets/javascripts/behaviors/markdown/nodes/image.js b/app/assets/javascripts/behaviors/markdown/nodes/image.js index ade5839d10b..4cc28c45739 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/image.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/image.js @@ -29,7 +29,7 @@ export default class Image extends BaseImage { }, // Matches HTML generated by Banzai::Filter::ImageLazyLoadFilter { - tag: 'img[src]', + tag: 'img[src]:not(.emoji)', getAttrs: (el) => { const imageSrc = el.src; const imageUrl = |