From 9c0dc7428920fab3fffac9d576b7cffa4388eb98 Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Tue, 5 Jul 2016 09:58:28 +0530 Subject: [PATCH] feat: use svg emoji --- src/HtmlUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 91bb063ee2..67123fe3dd 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -21,10 +21,10 @@ var sanitizeHtml = require('sanitize-html'); var highlight = require('highlight.js'); var linkifyMatrix = require('./linkify-matrix'); import escape from 'lodash/escape'; -import {unicodeToImage, unicodeRegexp} from 'emojione'; +import emojione from 'emojione'; import classNames from 'classnames'; -const EMOJI_REGEX = new RegExp(unicodeRegexp+"+", "gi"); +const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp+"+", "gi"); var sanitizeHtmlParams = { allowedTags: [ @@ -209,7 +209,8 @@ module.exports = { }; } safeBody = sanitizeHtml(body, sanitizeHtmlParams); - safeBody = unicodeToImage(safeBody); + emojione.imageType = 'svg'; + safeBody = emojione.unicodeToImage(safeBody); } finally { delete sanitizeHtmlParams.textFilter;