Skip to content

Commit cf2995d

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/String/Extra.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ dasherize : String -> String
354354
dasherize string =
355355
string
356356
|> String.trim
357-
|> Regex.replace (regexFromString "([A-Z])") (.match >> String.append "-")
358-
|> Regex.replace (regexFromString "[_-\\s]+") (always "-")
357+
|> underscored
358+
|> String.replace "_" "-"
359359
|> String.toLower
360360

361361

0 commit comments

Comments
 (0)