mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* 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
40 lines
1003 B
JavaScript
40 lines
1003 B
JavaScript
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
|
// 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';
|
|
|
|
export default class MessageWrapper extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {};
|
|
}
|
|
|
|
render() {
|
|
if (this.props.message) {
|
|
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/>;
|
|
}
|
|
}
|
|
|
|
MessageWrapper.defaultProps = {
|
|
message: ''
|
|
};
|
|
MessageWrapper.propTypes = {
|
|
message: React.PropTypes.string,
|
|
options: React.PropTypes.object
|
|
};
|