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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
51ad59e0
Commit
51ad59e0
authored
Apr 21, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug causing `@whatever` inside code blocks to sometimes be picked up as a user mention.
parent
76aade28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
CHANGELOG
CHANGELOG
+2
-1
app/models/concerns/mentionable.rb
app/models/concerns/mentionable.rb
+1
-1
lib/gitlab/reference_extractor.rb
lib/gitlab/reference_extractor.rb
+2
-2
No files found.
CHANGELOG
View file @
51ad59e0
...
@@ -3,7 +3,8 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,7 +3,8 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased)
v 7.11.0 (unreleased)
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Ignore invalid lines in .gitmodules
- Ignore invalid lines in .gitmodules
-
- Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention.
- Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention.
-
-
-
-
-
-
...
...
app/models/concerns/mentionable.rb
View file @
51ad59e0
...
@@ -28,7 +28,7 @@ module Mentionable
...
@@ -28,7 +28,7 @@ module Mentionable
# Construct a String that contains possible GFM references.
# Construct a String that contains possible GFM references.
def
mentionable_text
def
mentionable_text
self
.
class
.
mentionable_attrs
.
map
{
|
attr
|
send
(
attr
)
||
''
}.
join
self
.
class
.
mentionable_attrs
.
map
{
|
attr
|
send
(
attr
)
}.
compact
.
join
(
"
\n\n
"
)
end
end
# The GFM reference to this Mentionable, which shouldn't be included in its #references.
# The GFM reference to this Mentionable, which shouldn't be included in its #references.
...
...
lib/gitlab/reference_extractor.rb
View file @
51ad59e0
...
@@ -18,8 +18,8 @@ module Gitlab
...
@@ -18,8 +18,8 @@ module Gitlab
text
=
text
.
dup
text
=
text
.
dup
# Remove preformatted/code blocks so that references are not included
# Remove preformatted/code blocks so that references are not included
text
.
gsub!
(
%r{<pre>.*?</pre>|<code>.*?</code>}m
)
{
|
match
|
''
}
text
.
gsub!
(
/^```.*?^```/m
,
''
)
text
.
gsub!
(
%r{^```.*?^```}m
)
{
|
match
|
''
}
text
.
gsub!
(
/[^`]`[^`]*?`[^`]/
,
''
)
@references
=
Hash
.
new
{
|
hash
,
type
|
hash
[
type
]
=
[]
}
@references
=
Hash
.
new
{
|
hash
,
type
|
hash
[
type
]
=
[]
}
parse_references
(
text
)
parse_references
(
text
)
...
...
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