[PLT-1444] Created latinise function and updated cleanUpUrlable function to utilize (#6273)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
375cdbdb13
Коммит
4da45c0e76
1003
webapp/utils/latinise.jsx
Обычный файл
1003
webapp/utils/latinise.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(/-+$/, '');
|
||||
|
||||
Ссылка в новой задаче
Block a user