Moved twemoji parsing so that it doesn't occur inside of code blocks (#2896)

Этот коммит содержится в:
Harrison Healey
2016-05-05 15:35:01 -04:00
коммит произвёл Corey Hulen
родитель 511be7714b
Коммит ed3162a59d
4 изменённых файлов: 9 добавлений и 67 удалений

Просмотреть файл

@@ -7,6 +7,7 @@ import Constants from './constants.jsx';
import * as Emoticons from './emoticons.jsx';
import * as Markdown from './markdown.jsx';
import UserStore from 'stores/user_store.jsx';
import twemoji from 'twemoji';
import * as Utils from './utils.jsx';
// Performs formatting of user posts including highlighting mentions and search terms and converting urls, hashtags, and
@@ -62,6 +63,14 @@ export function doFormatText(text, options) {
// reinsert tokens with formatted versions of the important words and phrases
output = replaceTokens(output, tokens);
if (!('emoticons' in options) || options.emoticon) {
output = twemoji.parse(output, {
className: 'emoticon',
base: '',
folder: Constants.EMOJI_PATH
});
}
return output;
}