From 126c2e56e0b0a8649a559f10ecab671bf26238df Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 8 Jul 2015 10:32:33 -0700 Subject: Semicolons and a bug fix --- web/react/utils/utils.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'web') 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("
", "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({prefix}@{name}{suffix} ); } 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({prefix}{match.text}{suffix} ); -- cgit v1.2.3-1-g7c22