Replaces smileys and the logic of replacing links/emails. (#3560)

* Replaces smileys and the logic of replacing links/emails.

Now using react-emoji-render and react-linkify.

* Fixes heart emoji.

It is known that current implementation doesn't work with ascii emojis that contain < or >, like >:( >:-( </3 <\3 <3. Making those work may bring some xss issues.

* Adds '_blank' and 'noopener noreferrer' to the replaced links.

* Fixes package-lock links (http vs https).

* Fixes comments.
This commit is contained in:
Дамян Минков
2018-12-03 18:01:40 +00:00
committed by GitHub
parent 34f2ff9b85
commit f11b6cbb1e
30 changed files with 124 additions and 1876 deletions

View File

@@ -2,6 +2,7 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import Emoji from 'react-emoji-render';
import { sendMessage } from '../actions';
@@ -99,9 +100,9 @@ class ChatInput extends Component<Props, State> {
<div className = 'smiley-input'>
<div id = 'smileysarea'>
<div id = 'smileys'>
<img
<Emoji
onClick = { this._onToggleSmileysPanel }
src = 'images/smile.svg' />
text = ':)' />
</div>
</div>
<div className = { smileysPanelClassName }>