summaryrefslogtreecommitdiffstats
path: root/webapp/utils/url.jsx
diff options
context:
space:
mode:
authorchrismatteson <chris.matteson@gmail.com>2017-05-15 07:09:39 -0700
committerJoram Wilander <jwawilander@gmail.com>2017-05-15 10:09:39 -0400
commit4da45c0e760b3a62506f94948749df3b73397385 (patch)
tree4a72126cf472e47918f03d62d4170128c1327ec7 /webapp/utils/url.jsx
parent375cdbdb13d73abbab185980c3047c781e830df9 (diff)
downloadchat-4da45c0e760b3a62506f94948749df3b73397385.tar.gz
chat-4da45c0e760b3a62506f94948749df3b73397385.tar.bz2
chat-4da45c0e760b3a62506f94948749df3b73397385.zip
[PLT-1444] Created latinise function and updated cleanUpUrlable function to utilize (#6273)
Diffstat (limited to 'webapp/utils/url.jsx')
-rw-r--r--webapp/utils/url.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/webapp/utils/url.jsx b/webapp/utils/url.jsx
index 060d8256a..f1edf58c1 100644
--- a/webapp/utils/url.jsx
+++ b/webapp/utils/url.jsx
@@ -1,8 +1,11 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import {latinise} from 'utils/latinise.jsx';
+
export function cleanUpUrlable(input) {
- var cleaned = input.trim().replace(/-/g, ' ').replace(/[^\w\s]/gi, '').toLowerCase().replace(/\s/g, '-');
+ var cleaned = latinise(input);
+ cleaned = cleaned.trim().replace(/-/g, ' ').replace(/[^\w\s]/gi, '').toLowerCase().replace(/\s/g, '-');
cleaned = cleaned.replace(/-{2,}/, '-');
cleaned = cleaned.replace(/^-+/, '');
cleaned = cleaned.replace(/-+$/, '');