ChatMessage = React.createClass({ sanitizeAndFormat: function(str) { let res; if(typeof str === 'string') { // First, replace replace all tags with the ascii equivalent (excluding those involved in anchor tags) res = str.replace(/&/g, '&').replace(/<(?![au\/])/g, '<').replace(/\/([^au])>/g, '$1>').replace(/([^=])"(?!>)/g, '$1"'); res = this.toClickable(res); return res = this.activateBreakLines(res); } }, toClickable: function(str) { let res; if(typeof str === 'string') { res = str.replace(/ {this.toClockTime(this.props.message.message.from_time)} ); } else { return ( ); } }, render(){ var messageColor = { color: colourToHex(this.props.message.message.from_color) }; var floatLeft = {float: 'left'}; function createMarkup(str) { return {__html: str}; }; return (
  • {this.props.message.message.from_username ? {this.props.message.message.from_username} : null } {this.getTime()}
    {this.autoscroll()}
  • ); } });