Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9c0dc74

Browse files
committed
feat: use svg emoji
1 parent 4069886 commit 9c0dc74

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/HtmlUtils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ var sanitizeHtml = require('sanitize-html');
2121
var highlight = require('highlight.js');
2222
var linkifyMatrix = require('./linkify-matrix');
2323
import escape from 'lodash/escape';
24-
import {unicodeToImage, unicodeRegexp} from 'emojione';
24+
import emojione from 'emojione';
2525
import classNames from 'classnames';
2626

27-
const EMOJI_REGEX = new RegExp(unicodeRegexp+"+", "gi");
27+
const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp+"+", "gi");
2828

2929
var sanitizeHtmlParams = {
3030
allowedTags: [
@@ -209,7 +209,8 @@ module.exports = {
209209
};
210210
}
211211
safeBody = sanitizeHtml(body, sanitizeHtmlParams);
212-
safeBody = unicodeToImage(safeBody);
212+
emojione.imageType = 'svg';
213+
safeBody = emojione.unicodeToImage(safeBody);
213214
}
214215
finally {
215216
delete sanitizeHtmlParams.textFilter;

0 commit comments

Comments
 (0)