summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-09-16 14:01:05 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-09-16 14:08:10 -0400
commit60d2cff723bf0e4e87404162c8915b4d8043085e (patch)
treecf38dcef50eb4f7f5b94d01d78222458d0586928 /web
parentd4887cef03e3321910d33d672c194d1966cd0aac (diff)
downloadchat-60d2cff723bf0e4e87404162c8915b4d8043085e.tar.gz
chat-60d2cff723bf0e4e87404162c8915b4d8043085e.tar.bz2
chat-60d2cff723bf0e4e87404162c8915b4d8043085e.zip
Replaced instances of startsWith with lastIndexOf in TextFormatting
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/text_formatting.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 2c67d7a46..2025e16da 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -56,7 +56,7 @@ function autolinkUrls(text, tokens) {
const linkText = match.getMatchedText();
let url = linkText;
- if (!url.startsWith('http')) {
+ if (!url.lastIndexOf('http', 0) === 0) {
url = `http://${linkText}`;
}
@@ -160,7 +160,7 @@ function autolinkHashtags(text, tokens) {
var newTokens = new Map();
for (const [alias, token] of tokens) {
- if (token.originalText.startsWith('#')) {
+ if (token.originalText.lastIndexOf('#', 0) === 0) {
const index = tokens.size + newTokens.size;
const newAlias = `__MM_HASHTAG${index}__`;