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
50850d4d94e4
Commit
b263a33c
authored
May 25, 2015
by
Robert Speicher
Browse files
Better handle label references that aren't actually references
Fixes #1690
parent
fbe2d446fdcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/markdown/label_reference_filter.rb
View file @
50850d4d
...
...
@@ -84,11 +84,11 @@ def render_colored_label(label)
#
# Returns a Hash.
def
label_params
(
id
,
name
)
if
id
>
0
{
id:
id
}
else
if
name
# TODO (rspeicher): Don't strip single quotes if we decide to only use double quotes for surrounding.
{
name:
name
.
tr
(
'\'"'
,
''
)
}
else
{
id:
id
}
end
end
end
...
...
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
View file @
50850d4d
...
...
@@ -149,5 +149,12 @@ module Gitlab::Markdown
end
end
end
describe
'edge cases'
do
it
'gracefully handles non-references matching the pattern'
do
exp
=
act
=
'(format nil "~0f" 3.0) ; 3.0'
expect
(
filter
(
act
).
to_html
).
to
eq
exp
end
end
end
end
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