diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-08 10:32:33 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-08 10:32:33 -0700 |
commit | 126c2e56e0b0a8649a559f10ecab671bf26238df (patch) | |
tree | 98f0d50c63e511e186b15fdb86a816328433784b /web/react | |
parent | 9873ffd05fc16db4c305c1e98cdf3347f2aa0816 (diff) | |
download | chat-126c2e56e0b0a8649a559f10ecab671bf26238df.tar.gz chat-126c2e56e0b0a8649a559f10ecab671bf26238df.tar.bz2 chat-126c2e56e0b0a8649a559f10ecab671bf26238df.zip |
Semicolons and a bug fix
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/utils/utils.jsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index ce803c2fb..e6c460959 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -231,11 +231,11 @@ module.exports.extractLinks = function(text) { var repRegex = new RegExp("<br>", "g"); var matches = testUrlMatch(text.replace(repRegex, "\n")); - if (!matches) return { "links": null, "text": text }; + if (!matches.length) return { "links": null, "text": text }; - var links = [] + var links = []; for (var i = 0; i < matches.length; i++) { - links.push(matches[i].link) + links.push(matches[i].link); } return { "links": links, "text": text }; @@ -450,9 +450,9 @@ module.exports.textToJsx = function(text, options) { inner.push(<span key={name+i+z+"_span"}>{prefix}<a className={mClass + highlightSearchClass + " mention-link"} key={name+i+z+"_link"} href="#" onClick={function(value) { return function() { module.exports.searchForTerm(value); } }(name)}>@{name}</a>{suffix} </span>); } else if (testUrlMatch(word).length) { var match = testUrlMatch(word)[0]; - var link = match.link + var link = match.link; - var prefix = word.substring(0,word.indexOf(match.text)) + var prefix = word.substring(0,word.indexOf(match.text)); var suffix = word.substring(word.indexOf(match.text)+match.text.length); inner.push(<span key={word+i+z+"_span"}>{prefix}<a key={word+i+z+"_link"} className={"theme" + highlightSearchClass} target="_blank" href={link}>{match.text}</a>{suffix} </span>); |