From ed3162a59d522981cd6b63e578d31e0a96b5d2ff Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 5 May 2016 15:35:01 -0400 Subject: Moved twemoji parsing so that it doesn't occur inside of code blocks (#2896) --- webapp/components/post_body.jsx | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'webapp/components/post_body.jsx') diff --git a/webapp/components/post_body.jsx b/webapp/components/post_body.jsx index a159dcbb1..6c4e97d8e 100644 --- a/webapp/components/post_body.jsx +++ b/webapp/components/post_body.jsx @@ -1,13 +1,11 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import ReactDOM from 'react-dom'; import FileAttachmentList from './file_attachment_list.jsx'; import UserStore from 'stores/user_store.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; import * as TextFormatting from 'utils/text_formatting.jsx'; -import twemoji from 'twemoji'; import PostBodyAdditionalContent from './post_body_additional_content.jsx'; import {FormattedMessage} from 'react-intl'; @@ -17,39 +15,6 @@ import loadingGif from 'images/load.gif'; import React from 'react'; export default class PostBody extends React.Component { - constructor(props) { - super(props); - - this.parseEmojis = this.parseEmojis.bind(this); - } - - getAllChildNodes(nodeIn) { - var textNodes = []; - - function getTextNodes(node) { - textNodes.push(node); - - for (var i = 0, len = node.childNodes.length; i < len; ++i) { - getTextNodes(node.childNodes[i]); - } - } - - getTextNodes(nodeIn); - return textNodes; - } - - parseEmojis() { - twemoji.parse(ReactDOM.findDOMNode(this), { - className: 'emoticon', - base: '', - folder: Constants.EMOJI_PATH - }); - } - - componentDidMount() { - this.parseEmojis(); - } - shouldComponentUpdate(nextProps) { if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) { return true; -- cgit v1.2.3-1-g7c22