Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Commit 81b3cbf

Browse files
author
David Underwood
committed
Merge branch 'master' of github.com:Shopify/dashing
* 'master' of github.com:Shopify/dashing: Handle widgets with multiple capital letters
2 parents 3af326d + de40223 commit 81b3cbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascripts/dashing.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Batman.Filters.dashize = (str) ->
1111
dashes_rx1 = /([A-Z]+)([A-Z][a-z])/g;
1212
dashes_rx2 = /([a-z\d])([A-Z])/g;
1313

14-
return str.replace(dashes_rx1, '$1_$2').replace(dashes_rx2, '$1_$2').replace('_', '-').toLowerCase()
14+
return str.replace(dashes_rx1, '$1_$2').replace(dashes_rx2, '$1_$2').replace(/_/g, '-').toLowerCase()
1515

1616
Batman.Filters.shortenedNumber = (num) ->
1717
return num if isNaN(num)

0 commit comments

Comments
 (0)