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
850ad46f
Commit
850ad46f
authored
Jan 27, 2021
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression with old wiki image uploads
parent
a6080c29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
app/helpers/markup_helper.rb
app/helpers/markup_helper.rb
+2
-1
changelogs/unreleased/fj-fix-regression-old-uploads.yml
changelogs/unreleased/fj-fix-regression-old-uploads.yml
+5
-0
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+15
-0
No files found.
app/helpers/markup_helper.rb
View file @
850ad46f
...
...
@@ -126,7 +126,8 @@ module MarkupHelper
text
=
wiki_page
.
content
return
''
unless
text
.
present?
html
=
markup_unsafe
(
wiki_page
.
path
,
text
,
render_wiki_content_context
(
@wiki
,
wiki_page
,
context
))
context
=
render_wiki_content_context
(
@wiki
,
wiki_page
,
context
)
html
=
markup_unsafe
(
wiki_page
.
path
,
text
,
context
)
prepare_for_rendering
(
html
,
context
)
end
...
...
changelogs/unreleased/fj-fix-regression-old-uploads.yml
0 → 100644
View file @
850ad46f
---
title
:
Fix regression with old wiki image uploads
merge_request
:
52656
author
:
type
:
fixed
spec/helpers/markup_helper_spec.rb
View file @
850ad46f
...
...
@@ -355,6 +355,21 @@ RSpec.describe MarkupHelper do
expect
(
doc
.
css
(
'.gl-label-link'
)).
not_to
be_empty
end
end
context
'when content has uploads'
do
let
(
:upload_link
)
{
'/uploads/test.png'
}
let
(
:content
)
{
"![ImageTest](
#{
upload_link
}
)"
}
before
do
allow
(
wiki
).
to
receive
(
:wiki_base_path
).
and_return
(
project
.
wiki
.
wiki_base_path
)
end
it
'renders uploads relative to project'
do
result
=
helper
.
render_wiki_content
(
wiki
)
expect
(
result
).
to
include
(
"
#{
project
.
full_path
}#{
upload_link
}
"
)
end
end
end
context
'when file is Asciidoc'
do
...
...
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