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
57357470
Commit
57357470
authored
Jan 24, 2018
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add formatted_data attribute to Git::WikiPage
Related to #39805
parent
a403011e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
lib/gitlab/git/wiki_page.rb
lib/gitlab/git/wiki_page.rb
+2
-1
spec/models/wiki_page_spec.rb
spec/models/wiki_page_spec.rb
+11
-0
No files found.
lib/gitlab/git/wiki_page.rb
View file @
57357470
module
Gitlab
module
Gitlab
module
Git
module
Git
class
WikiPage
class
WikiPage
attr_reader
:url_path
,
:title
,
:format
,
:path
,
:version
,
:raw_data
,
:name
,
:text_data
,
:historical
attr_reader
:url_path
,
:title
,
:format
,
:path
,
:version
,
:raw_data
,
:name
,
:text_data
,
:historical
,
:formatted_data
# 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.
...
@@ -21,6 +21,7 @@ module Gitlab
...
@@ -21,6 +21,7 @@ module Gitlab
@raw_data
=
gollum_page
.
raw_data
@raw_data
=
gollum_page
.
raw_data
@name
=
gollum_page
.
name
@name
=
gollum_page
.
name
@historical
=
gollum_page
.
historical?
@historical
=
gollum_page
.
historical?
@formatted_data
=
gollum_page
.
formatted_data
if
gollum_page
.
is_a?
(
Gollum
::
Page
)
@version
=
version
@version
=
version
end
end
...
...
spec/models/wiki_page_spec.rb
View file @
57357470
...
@@ -386,6 +386,17 @@ describe WikiPage do
...
@@ -386,6 +386,17 @@ describe WikiPage do
end
end
end
end
describe
'#formatted_content'
do
it
'returns processed content of the page'
,
:disable_gitaly
do
subject
.
create
({
title:
"RDoc"
,
content:
"*bold*"
,
format:
"rdoc"
})
page
=
wiki
.
find_page
(
'RDoc'
)
expect
(
page
.
formatted_content
).
to
eq
(
"
\n
<p><strong>bold</strong></p>
\n
"
)
destroy_page
(
'RDoc'
)
end
end
private
private
def
remove_temp_repo
(
path
)
def
remove_temp_repo
(
path
)
...
...
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