summaryrefslogtreecommitdiffstats
path: root/webapp/components/message_wrapper.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-08-29 09:50:00 -0400
committerChristopher Speller <crspeller@gmail.com>2016-08-29 09:50:00 -0400
commit167dd22eefeeeb9c1eaebd990a4f5902bd366302 (patch)
tree6ddb15a80b2a608d42e20df72b98c0ae72821671 /webapp/components/message_wrapper.jsx
parent55342e8fe16613f06528ed1aa726231e9b597d26 (diff)
downloadchat-167dd22eefeeeb9c1eaebd990a4f5902bd366302.tar.gz
chat-167dd22eefeeeb9c1eaebd990a4f5902bd366302.tar.bz2
chat-167dd22eefeeeb9c1eaebd990a4f5902bd366302.zip
PLT-1752/PLT-3567/PLT-3998 Highlighting links in search, unit tests for autolinking (#3865)
* Added highlighting to links when their URL includes the search term * Decoupling UserStore from react-router to allow for unit tests involving it * PLT-3998 Added SiteURL as an option to be passed into the text formatting code * Removed reference to PreferenceStore and window from TextFormatting * Refactored TextFormatting to remove remaining browser-only code * Updated ChannelHeader and MessageWrapper to match the changes to TextFormatting * Increased max listeners for Preference and Emoji stores * PLT-3832 Added automated unit tests for autolinking * PLT-3567 Rerender posts when mention keywords change * Updated RHS and search to match the changes to TextFormatting * Broke TextFormatting's dependency on the UserStore
Diffstat (limited to 'webapp/components/message_wrapper.jsx')
-rw-r--r--webapp/components/message_wrapper.jsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/webapp/components/message_wrapper.jsx b/webapp/components/message_wrapper.jsx
index 5e9939efa..4dba1024e 100644
--- a/webapp/components/message_wrapper.jsx
+++ b/webapp/components/message_wrapper.jsx
@@ -2,6 +2,7 @@
// See License.txt for license information.
import * as TextFormatting from 'utils/text_formatting.jsx';
+import * as Utils from 'utils/utils.jsx';
import React from 'react';
@@ -10,9 +11,19 @@ export default class MessageWrapper extends React.Component {
super(props);
this.state = {};
}
+
render() {
if (this.props.message) {
- return <div dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.message, this.props.options)}}/>;
+ const options = Object.assign({}, this.props.options, {
+ siteURL: Utils.getSiteURL()
+ });
+
+ return (
+ <div
+ onClick={Utils.handleFormattedTextClick}
+ dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.message, options)}}
+ />
+ );
}
return <div/>;