Skip to content
Snippets Groups Projects
Verified Commit 5a002723 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Allow slashes in slash command arguments


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b08be165
No related branches found
No related tags found
No related merge requests found
---
title: Allow slashes in slash command arguments
merge_request:
author:
Loading
Loading
@@ -103,7 +103,7 @@ module Gitlab
(?<cmd>#{Regexp.union(names)})
(?:
[ ]
(?<arg>[^\/\n]*)
(?<arg>[^\n]*)
)?
(?:\n|$)
)
Loading
Loading
Loading
Loading
@@ -81,6 +81,14 @@ describe Gitlab::SlashCommands::Extractor do
let(:original_msg) { "/assign @joe\nworld" }
let(:final_msg) { "world" }
end
it 'allows slash in command arguments' do
msg = "/assign @joe / @jane\nworld"
msg, commands = extractor.extract_commands(msg)
expect(commands).to eq [['assign', '@joe / @jane']]
expect(msg).to eq 'world'
end
end
 
context 'in the middle of content' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment