mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Title prettify shoundn't downcase all non-ascii titles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user