rename searchTerms to highlights, and support highlighting multiple search terms

This commit is contained in:
Matthew Hodgson 2015-11-29 03:22:01 +00:00
parent 3cc1b1ad82
commit 0b483c4707
4 changed files with 74 additions and 31 deletions

View file

@ -43,13 +43,13 @@ module.exports = React.createClass({
shouldComponentUpdate: function(nextProps) {
// exploit that events are immutable :)
return (nextProps.mxEvent.getId() !== this.props.mxEvent.getId() ||
nextProps.searchTerm !== this.props.searchTerm);
nextProps.highlights !== this.props.highlights);
},
render: function() {
var mxEvent = this.props.mxEvent;
var content = mxEvent.getContent();
var body = HtmlUtils.bodyToHtml(content, this.props.searchTerm);
var body = HtmlUtils.bodyToHtml(content, this.props.highlights);
switch (content.msgtype) {
case "m.emote":