Merge branch 'master' of github.com:gitlabhq/gitlabhq
This commit is contained in:
commit
0fd06adf0c
|
@ -90,7 +90,7 @@ module TreeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def editing_preview_title(filename)
|
def editing_preview_title(filename)
|
||||||
if gitlab_markdown?(filename) || markup?(filename)
|
if Gitlab::MarkdownHelper.previewable?(filename)
|
||||||
'Preview'
|
'Preview'
|
||||||
else
|
else
|
||||||
'Diff'
|
'Diff'
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Tree
|
||||||
# by markup renderer.
|
# by markup renderer.
|
||||||
if available_readmes.length > 1
|
if available_readmes.length > 1
|
||||||
supported_readmes = available_readmes.select do |readme|
|
supported_readmes = available_readmes.select do |readme|
|
||||||
gitlab_markdown?(readme.name) || markup?(readme.name)
|
previewable?(readme.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Take the first supported readme, or the first available readme, if we
|
# Take the first supported readme, or the first available readme, if we
|
||||||
|
|
|
@ -21,5 +21,9 @@ module Gitlab
|
||||||
def gitlab_markdown?(filename)
|
def gitlab_markdown?(filename)
|
||||||
filename.downcase.end_with?(*%w(.mdown .md .markdown))
|
filename.downcase.end_with?(*%w(.mdown .md .markdown))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def previewable?(filename)
|
||||||
|
gitlab_markdown?(filename) || markup?(filename)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue