Commit 0fd06adf authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Merge branch 'master' of github.com:gitlabhq/gitlabhq

......@@ -90,7 +90,7 @@ def leave_edit_message
end
def editing_preview_title(filename)
if gitlab_markdown?(filename) || markup?(filename)
if Gitlab::MarkdownHelper.previewable?(filename)
'Preview'
else
'Diff'
......
......@@ -15,7 +15,7 @@ def initialize(repository, sha, path = '/')
# by markup renderer.
if available_readmes.length > 1
supported_readmes = available_readmes.select do |readme|
gitlab_markdown?(readme.name) || markup?(readme.name)
previewable?(readme.name)
end
# Take the first supported readme, or the first available readme, if we
......
......@@ -21,5 +21,9 @@ def markup?(filename)
def gitlab_markdown?(filename)
filename.downcase.end_with?(*%w(.mdown .md .markdown))
end
def previewable?(filename)
gitlab_markdown?(filename) || markup?(filename)
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment