From 355d1ace7b2b8cb669e4e0aa16115c3c84fc5309 Mon Sep 17 00:00:00 2001 From: leethomas Date: Sat, 14 May 2016 22:24:56 -0700 Subject: [PATCH] update comment parsing rules to exclude non sentence terminating periods, include exclamation marks --- lib/rake/task.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 1d3244d2b..5300b6fc4 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -304,10 +304,10 @@ def transform_comments(separator, &block) private :transform_comments # Get the first sentence in a string. The sentence is terminated - # by the first period or the end of the line. Decimal points do - # not count as periods. + # by the first period, exclamation mark, or the end of the line. + # Decimal points do not count as periods. def first_sentence(string) - string.split(/\.[ \t]|\.$|\n/).first + string.split(/(?<=\w)(\.|!)[ \t]|(\.$|!)|\n/).first end private :first_sentence