diff options
author | chrismatteson <chris.matteson@gmail.com> | 2017-05-15 07:09:39 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-05-15 10:09:39 -0400 |
commit | 4da45c0e760b3a62506f94948749df3b73397385 (patch) | |
tree | 4a72126cf472e47918f03d62d4170128c1327ec7 /webapp/utils/url.jsx | |
parent | 375cdbdb13d73abbab185980c3047c781e830df9 (diff) | |
download | chat-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.jsx | 5 |
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(/-+$/, ''); |