mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Test for existing title
This commit is contained in:
parent
adae5d78f5
commit
fd87f59bbb
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ class TextCleaner
|
||||||
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 =~ /[A-Z]+/) && (text == text.upcase)
|
||||||
# Capitalize first letter, but only when entire first word is lowercase
|
# Capitalize first letter, but only when entire first word is lowercase
|
||||||
first, rest = text.split(' ', 2)
|
first, rest = text.split(' ', 2)
|
||||||
if opts[:capitalize_first_letter] && first == first.mb_chars.downcase
|
if first && opts[:capitalize_first_letter] && first == first.mb_chars.downcase
|
||||||
text = "#{first.mb_chars.capitalize}#{rest ? ' ' + rest : ''}"
|
text = "#{first.mb_chars.capitalize}#{rest ? ' ' + rest : ''}"
|
||||||
end
|
end
|
||||||
# Remove unnecessary periods at the end
|
# Remove unnecessary periods at the end
|
||||||
|
|
Loading…
Reference in a new issue