wiki pages: fix normalization of wiki page title.

Fix the wiki page title "azur___lane" being normalized to "azur__lane"
instead of "azur_lane".
This commit is contained in:
evazion
2021-01-09 18:42:33 -06:00
parent ff6e640fcb
commit 7fbac34962
2 changed files with 4 additions and 1 deletions

View File

@@ -150,7 +150,7 @@ class WikiPage < ApplicationRecord
end
def self.normalize_title(title)
title.to_s.downcase.delete_prefix("~").gsub(/[[:space:]]+/, "_").gsub(/__/, "_").gsub(/\A_|_\z/, "")
title.to_s.downcase.delete_prefix("~").gsub(/[[:space:]]+/, "_").squeeze("_").gsub(/\A_|_\z/, "")
end
def normalize_other_names