mirror of https://github.com/vector-im/riot-web
parent
44b23d2191
commit
0105f566c9
|
@ -994,7 +994,7 @@ Commands.forEach((cmd) => {
|
||||||
export function parseCommandString(input: string): { cmd?: string; args?: string } {
|
export function parseCommandString(input: string): { cmd?: string; args?: string } {
|
||||||
// trim any trailing whitespace, as it can confuse the parser for IRC-style commands
|
// trim any trailing whitespace, as it can confuse the parser for IRC-style commands
|
||||||
input = input.trimEnd();
|
input = input.trimEnd();
|
||||||
if (input.startsWith("/")) return {}; // not a command
|
if (!input.startsWith("/")) return {}; // not a command
|
||||||
|
|
||||||
const bits = input.match(/^(\S+?)(?:[ \n]+((.|\n)*))?$/);
|
const bits = input.match(/^(\S+?)(?:[ \n]+((.|\n)*))?$/);
|
||||||
let cmd: string;
|
let cmd: string;
|
||||||
|
|
Loading…
Reference in New Issue