[MM-33892] Replace em dash with double dash for commands (#5259)
* replace em dash with double dash for commands * style * missing semi
This commit is contained in:
parent
d898286ec9
commit
e49c0314cc
1 changed files with 6 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ export function executeCommand(message: string, channelId: string, rootId: strin
|
|||
};
|
||||
|
||||
let msg = message;
|
||||
msg = filterEmDashForCommand(msg);
|
||||
|
||||
let cmdLength = msg.indexOf(' ');
|
||||
if (cmdLength < 0) {
|
||||
|
|
@ -43,7 +44,7 @@ export function executeCommand(message: string, channelId: string, rootId: strin
|
|||
if (appsAreEnabled) {
|
||||
const parser = new AppCommandParser({dispatch, getState}, intl, args.channel_id, args.root_id);
|
||||
if (parser.isAppCommand(msg)) {
|
||||
const {call, errorMessage} = await parser.composeCallFromCommand(message);
|
||||
const {call, errorMessage} = await parser.composeCallFromCommand(msg);
|
||||
const createErrorMessage = (errMessage: string) => {
|
||||
return {error: {message: errMessage}};
|
||||
};
|
||||
|
|
@ -90,3 +91,7 @@ export function executeCommand(message: string, channelId: string, rootId: strin
|
|||
return {data, error};
|
||||
};
|
||||
}
|
||||
|
||||
const filterEmDashForCommand = (command: string): string => {
|
||||
return command.replace(/\u2014/g, '--');
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue