Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d5926290
Commit
d5926290
authored
Mar 12, 2020
by
Pavlo Dudchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
204774 Quick actions executed in multiline inline code, when placed on it's own line
parent
2a04cd76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
changelogs/unreleased/204774-quick-actions-executed-in-multiline-inline-code.yml
...04774-quick-actions-executed-in-multiline-inline-code.yml
+5
-0
lib/gitlab/quick_actions/extractor.rb
lib/gitlab/quick_actions/extractor.rb
+11
-0
spec/lib/gitlab/quick_actions/extractor_spec.rb
spec/lib/gitlab/quick_actions/extractor_spec.rb
+27
-0
No files found.
changelogs/unreleased/204774-quick-actions-executed-in-multiline-inline-code.yml
0 → 100644
View file @
d5926290
---
title
:
Fix quick actions executing in multiline inline code when placed on its own line
merge_request
:
24933
author
:
Pavlo Dudchenko
type
:
fixed
lib/gitlab/quick_actions/extractor.rb
View file @
d5926290
...
...
@@ -105,6 +105,17 @@ module Gitlab
.+?
\n
```$
)
|
(?<inline_code>
# Inline code on separate rows:
# `
# Anything, including `/cmd arg` which are ignored by this filter
# `
^.*`
\n
*
.+?
\n
*`$
)
|
(?<html>
# HTML block:
...
...
spec/lib/gitlab/quick_actions/extractor_spec.rb
View file @
d5926290
...
...
@@ -291,6 +291,33 @@ describe Gitlab::QuickActions::Extractor do
expect
(
msg
).
to
eq
expected
end
it
'does not extract commands in multiline inline code on seperated rows'
do
msg
=
"Hello
\r\n
`
\r\n
This is some text
\r\n
/close
\r\n
/assign @user
\r\n
`
\r\n\r\n
World"
expected
=
msg
.
delete
(
"
\r
"
)
msg
,
commands
=
extractor
.
extract_commands
(
msg
)
expect
(
commands
).
to
be_empty
expect
(
msg
).
to
eq
expected
end
it
'does not extract commands in multiline inline code starting from text'
do
msg
=
"Hello `This is some text
\r\n
/close
\r\n
/assign @user
\r\n
`
\r\n\r\n
World"
expected
=
msg
.
delete
(
"
\r
"
)
msg
,
commands
=
extractor
.
extract_commands
(
msg
)
expect
(
commands
).
to
be_empty
expect
(
msg
).
to
eq
expected
end
it
'does not extract commands in inline code'
do
msg
=
"`This is some text
\r\n
/close
\r\n
/assign @user
\r\n
`
\r\n\r\n
World"
expected
=
msg
.
delete
(
"
\r
"
)
msg
,
commands
=
extractor
.
extract_commands
(
msg
)
expect
(
commands
).
to
be_empty
expect
(
msg
).
to
eq
expected
end
it
'limits to passed commands when they are passed'
do
msg
=
<<~
MSG
.
strip
Hello, we should only extract the commands passed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment