SSARHERPS / SSAR-species-database

SSAR North American Common Names Database
http://ssarherps.org/cndb/
GNU General Public License v3.0
2 stars 0 forks source link

Change English name to Lower case when following hyphen #75

Closed mkoo closed 9 years ago

mkoo commented 9 years ago

See ex. Red-Bellied should be Red-bellied http://ssarherps.org/cndb/polymer1beta/#cmVkLWJlbGxpZWQmbG9vc2U9dHJ1ZQ

submitted by Brian Crother

tigerhawkvok commented 9 years ago

Filtered through this regex function

smartUpperCasing = (text) ->
  replacer = (match) ->
    return match.replace(match, match.toUpperCase())
  text.replace(/((?=((?!-)[\W\s\r\n]))\s[A-Za-z]|^[A-Za-z])/g, replacer)