From 79f7c5d6ab0e7b0bad860039403fef195381cdbe Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 13 May 2018 03:29:56 +0100 Subject: [PATCH] remove // support, as it never worked if you want to escape a /, do it with \/ or just precede with a space --- src/SlashCommands.js | 2 +- src/components/views/rooms/MessageComposerInput.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SlashCommands.js b/src/SlashCommands.js index d45e45e84c..7f32c1e25a 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -434,7 +434,7 @@ module.exports = { // trim any trailing whitespace, as it can confuse the parser for // IRC-style commands input = input.replace(/\s+$/, ""); - if (input[0] === "/" && input[1] !== "/") { + if (input[0] === "/") { const bits = input.match(/^(\S+?)( +((.|\n)*))?$/); let cmd; let args; diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index a1b569b5f4..2a59ccbe7d 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -731,7 +731,7 @@ export default class MessageComposerInput extends React.Component { const firstGrandChild = firstChild && firstChild.nodes.get(0); if (firstChild && firstGrandChild && firstChild.object === 'block' && firstGrandChild.object === 'text' && - firstGrandChild.text[0] === '/' && firstGrandChild.text[1] !== '/') + firstGrandChild.text[0] === '/') { commandText = this.plainWithIdPills.serialize(editorState); cmd = SlashCommands.processInput(this.props.room.roomId, commandText);