diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/utils/text_formatting.jsx | 4 |
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}__`; |