FIX: Title prettify shoundn't downcase all non-ascii titles

This commit is contained in:
Rafael dos Santos Silva
2017-08-08 14:03:24 -03:00
parent e36a20660d
commit 5324c9817f
2 changed files with 5 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ class TextCleaner
# Replace ????? with a single ?
text.gsub!(/\?+/, '?') if opts[:deduplicate_question_marks]
# Replace all-caps text with regular case letters
text = text.mb_chars.downcase.to_s if opts[:replace_all_upper_case] && (text =~ /[A-Z]+/) && (text == text.upcase)
text = text.mb_chars.downcase.to_s if opts[:replace_all_upper_case] && (text == text.mb_chars.upcase)
# Capitalize first letter, but only when entire first word is lowercase
first, rest = text.split(' ', 2)
if first && opts[:capitalize_first_letter] && first == first.mb_chars.downcase