summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-14 15:08:42 +0000
committerDouwe Maan <douwe@gitlab.com>2016-01-14 15:08:42 +0000
commitb6454fef568352b9fffc2c4cb194c98c4af2efa9 (patch)
tree8d3607050daae37156d9f5f6979c7ac15f16fe93 /app/models
parentb6ae2def2cb2b1da3ddcb3ceee556628a1147cc4 (diff)
parent2450916dc6d8e022ad03350e42d7df1e1711905a (diff)
downloadgitlab-ce-b6454fef568352b9fffc2c4cb194c98c4af2efa9.tar.gz
Merge branch 'import-gh-wiki' into 'master'
Import GitHub wiki into GitLab Closes #2834 GitHub doesn’t apply any constraints to theirs wiki slug allowing chars like ,, :, *, etc, we need to remove our constraints or some wiki pages will not be available after they are imported. Some wikis use the Gollum's tags to link its internal/external resources like: images, urls, wiki pages, etc. So, to avoid that wiki links/images displays completely broken after they were imported, we added a new `WikiPipeline`, that for now will parse only simple links, and image tags. ##### Before `WikiPipeline`: ![Screenshot_2016-01-11_20.14.48](/uploads/46fd5dbb5acfc70aa8ecca3050b675e4/Screenshot_2016-01-11_20.14.48.png) ##### After `WikiPipeline`: ![Screenshot_2016-01-11_20.15.56](/uploads/b1d94aa852f385f867a7868c358b4257/Screenshot_2016-01-11_20.15.56.png) See merge request !2324
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_wiki.rb4
-rw-r--r--app/models/wiki_page.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index b5fec38378b..8ce47495971 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -38,6 +38,10 @@ class ProjectWiki
[Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('')
end
+ def wiki_base_path
+ ["/", @project.path_with_namespace, "/wikis"].join('')
+ end
+
# Returns the Gollum::Wiki object.
def wiki
@wiki ||= begin
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index e9413c34bae..2a65f0431c4 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -169,7 +169,7 @@ class WikiPage
private
def set_attributes
- attributes[:slug] = @page.escaped_url_path
+ attributes[:slug] = @page.url_path
attributes[:title] = @page.title
attributes[:format] = @page.format
end