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
Boxiang Sun
gitlab-ce
Commits
76becfb5
Commit
76becfb5
authored
Oct 23, 2017
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add path attribute to WikiFile class
Fixes #39420
parent
3ddffec0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
changelogs/unreleased/fix-add-path-attr-to-wiki-file.yml
changelogs/unreleased/fix-add-path-attr-to-wiki-file.yml
+5
-0
lib/gitlab/git/wiki_file.rb
lib/gitlab/git/wiki_file.rb
+2
-1
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
+7
-3
No files found.
changelogs/unreleased/fix-add-path-attr-to-wiki-file.yml
0 → 100644
View file @
76becfb5
---
title
:
Fix broken wiki pages that link to a wiki file
merge_request
:
15019
author
:
type
:
fixed
lib/gitlab/git/wiki_file.rb
View file @
76becfb5
module
Gitlab
module
Gitlab
module
Git
module
Git
class
WikiFile
class
WikiFile
attr_reader
:mime_type
,
:raw_data
,
:name
attr_reader
:mime_type
,
:raw_data
,
:name
,
:path
# This class is meant to be serializable so that it can be constructed
# This class is meant to be serializable so that it can be constructed
# by Gitaly and sent over the network to GitLab.
# by Gitaly and sent over the network to GitLab.
...
@@ -13,6 +13,7 @@ module Gitlab
...
@@ -13,6 +13,7 @@ module Gitlab
@mime_type
=
gollum_file
.
mime_type
@mime_type
=
gollum_file
.
mime_type
@raw_data
=
gollum_file
.
raw_data
@raw_data
=
gollum_file
.
raw_data
@name
=
gollum_file
.
name
@name
=
gollum_file
.
name
@path
=
gollum_file
.
path
end
end
end
end
end
end
...
...
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
View file @
76becfb5
...
@@ -15,9 +15,13 @@ describe Banzai::Filter::GollumTagsFilter do
...
@@ -15,9 +15,13 @@ describe Banzai::Filter::GollumTagsFilter do
context
'linking internal images'
do
context
'linking internal images'
do
it
'creates img tag if image exists'
do
it
'creates img tag if image exists'
do
file
=
Gollum
::
File
.
new
(
project_wiki
.
wiki
)
gollum_file_double
=
double
(
'Gollum::File'
,
expect
(
file
).
to
receive
(
:path
).
and_return
(
'images/image.jpg'
)
mime_type:
'image/jpeg'
,
expect
(
project_wiki
).
to
receive
(
:find_file
).
with
(
'images/image.jpg'
).
and_return
(
file
)
name:
'images/image.jpg'
,
path:
'images/image.jpg'
,
raw_data:
''
)
wiki_file
=
Gitlab
::
Git
::
WikiFile
.
new
(
gollum_file_double
)
expect
(
project_wiki
).
to
receive
(
:find_file
).
with
(
'images/image.jpg'
).
and_return
(
wiki_file
)
tag
=
'[[images/image.jpg]]'
tag
=
'[[images/image.jpg]]'
doc
=
filter
(
"See
#{
tag
}
"
,
project_wiki:
project_wiki
)
doc
=
filter
(
"See
#{
tag
}
"
,
project_wiki:
project_wiki
)
...
...
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