Skip to content

Commit 9d522d5

Browse files
committed
Fix codesandbox uglify error
1 parent 8cdf27e commit 9d522d5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/plugins/emoji.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
import emojiData from '../core/render/emojify-data';
2+
13
// Deprecation notice
24
if (window && window.console) {
35
console.info('Docsify emoji plugin has been deprecated as of v4.13');
46
}
7+
8+
// Emoji from GitHub API
9+
// https://api.github.com/emojis
10+
window.emojify = function (match, $1) {
11+
return Object.prototype.hasOwnProperty.call(emojiData, $1) === false
12+
? match
13+
: '<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/' +
14+
emojiData[$1] +
15+
'.png" alt="' +
16+
$1 +
17+
'" />';
18+
};

0 commit comments

Comments
 (0)