Skip to content

Commit ad6b448

Browse files
committed
Fix dasherize adding leading dash
Fixes elm-community#23
1 parent 10e131a commit ad6b448

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/String/Extra.elm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ The final string will be lowercased.
353353
dasherize : String -> String
354354
dasherize string =
355355
string
356-
|> String.trim
357-
|> Regex.replace (regexFromString "([A-Z])") (.match >> String.append "-")
358-
|> Regex.replace (regexFromString "[_-\\s]+") (always "-")
359-
|> String.toLower
356+
|> underscored
357+
|> String.replace "_" "-"
360358

361359

362360
{-| Separate a string into parts of a given width, using a given separator.

0 commit comments

Comments
 (0)