Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9780fb6cf819
Commit
9780fb6c
authored
Jul 04, 2018
by
Reuben Pereira
Browse files
Remove the restriction preventing project references with text adjacent to the > character
parent
6a84b2a4e5c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
9780fb6c
...
...
@@ -465,10 +465,9 @@
end
# Pattern used to extract `namespace/project>` project references from text.
# (?!\w) matches any non-word character.
# '>' or its escaped form ('>') are checked for because '>' is sometimes escaped
# when the reference comes from an external source.
def
markdown_reference_pattern
%r{
#{
reference_pattern
}
(
#{
reference_postfix
}
|
#{
reference_postfix_escaped
}
)
...
...
@@ -469,10 +468,9 @@
# '>' or its escaped form ('>') are checked for because '>' is sometimes escaped
# when the reference comes from an external source.
def
markdown_reference_pattern
%r{
#{
reference_pattern
}
(
#{
reference_postfix
}
|
#{
reference_postfix_escaped
}
)
(?!
\w
)
}x
end
...
...
spec/lib/banzai/filter/project_reference_filter_spec.rb
View file @
9780fb6c
...
...
@@ -24,9 +24,9 @@
expect
(
reference_filter
(
act
).
to_html
).
to
eq
(
CGI
.
escapeHTML
(
exp
))
end
it
'
ignore
s references with text after the >
sign
'
do
exp
=
act
=
"Hey
#{
reference
}
foo"
expect
(
reference_filter
(
act
).
to_html
).
to
eq
CGI
.
escapeHTML
(
exp
)
it
'
allow
s references with text after the >
character
'
do
doc
=
reference_filter
(
"Hey
#{
reference
}
foo"
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)).
to
eq
urls
.
project_url
(
subject
)
end
%w(pre code a style)
.
each
do
|
elem
|
...
...
Write
Preview
Supports
Markdown
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