Skip to content

Commit d04f62e

Browse files
authored
Count words with punctuation apostrophes considered
This is a follow-up of <#92>. I found that Unicode suggests using U+2019 `’` for punctuation instead of U+0027 `'`: <https://en.wikipedia.org/wiki/Apostrophe#Unicode>. For example, Google Docs automatically converts `He's` to `He’s`. So this patch adds support for U+2019 in addition to U+0027 in Sponsorship#word_count.
1 parent f832611 commit d04f62e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/sponsorship.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def slug
146146
end
147147

148148
def word_count
149-
profile&.scan(/[\w\-']+/)&.size || 0
149+
profile&.scan(/[\w\-']+/)&.size || 0
150150
end
151151

152152
def policy_agreement

0 commit comments

Comments
 (0)