|
|
|
@ -2,8 +2,7 @@ module FormattingHelper
|
|
|
|
|
def format_ending(text) |
|
|
|
|
return text if text.blank? |
|
|
|
|
|
|
|
|
|
first_word = text.split.first |
|
|
|
|
modified_text = first_word == first_word.upcase ? text : lowercase_first_letter(text) |
|
|
|
|
modified_text = lowercase_first_letter(text) |
|
|
|
|
ensure_sentence_ending(modified_text) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -17,6 +16,8 @@ module FormattingHelper
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def lowercase_first_letter(text) |
|
|
|
|
first_word = text.split.first |
|
|
|
|
return text if first_word == first_word.upcase |
|
|
|
|
return text if text.blank? |
|
|
|
|
|
|
|
|
|
text[0].downcase + text[1..] |
|
|
|
|