summaryrefslogtreecommitdiff
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
authorHiroyuki Sato <hiroyuki_sato@spiber.jp>2014-04-09 14:14:16 +0900
committerHiroyuki Sato <hiroyuki_sato@spiber.jp>2014-04-10 15:14:02 +0900
commitbca528a57c9276c0cd815d67fed4a72c514d53a2 (patch)
tree60a517c30bf3965b684be2ddcf3b8c4b9ea437ff /app/models/wiki_page.rb
parent03472b4fc02a256c90c0285765e7da82c56e93a2 (diff)
downloadgitlab-ce-bca528a57c9276c0cd815d67fed4a72c514d53a2.tar.gz
Better title format for wiki page
The title format for wiki page may be unintelligible. For example 'GitLab' is converted to 'Git Lab', 'MySQL' is converted to 'My Sql', etc.
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 431c1e33f55..4d8cfd6368f 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -47,7 +47,11 @@ class WikiPage
# The formatted title of this page.
def title
- @attributes[:title] || ""
+ if @attributes[:title]
+ @attributes[:title].gsub(/-+/, ' ')
+ else
+ ""
+ end
end
# Sets the title of this page.