When providing a multi-line payload to a slash command, it鈥檚 currently necessary to add a space character immediately after the trigger word (e.g. /standup \n<payload>) instead of being able to start the newline right away (e.g. /standup\n<payload>).
Fix this in ExecuteCommand by splitting /once/ on any whitespace character, and then reassembling safely. Be sure to write good unit tests to prevent regressions!
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
i am interested in looking into this.
@lieut-data Making sure if I understand the problem correctly, what do you think about solution of:
check if the first character after the / command is a newline character and if it is
(1) replace that newline with a space
or
(2) just add a space right before that newline character,
i am not sure how newlines are handled in the rest of command and how it affect things.
@allenlai18, I'd suggest trying to tweak the way we split apart the words instead, vs. trying to modify the payload. Could we detect the first non-whitespace character in the string and extract the trigger word up to that? That would also eliminate the need to split the whole command apart by spaces only to rejoin it.