We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c770076 commit 7b438c8Copy full SHA for 7b438c8
lib/algora/shared/util.ex
@@ -293,14 +293,16 @@ defmodule Algora.Util do
293
|> Calendar.strftime("%Y-%m-%d %H:%M:%S")
294
end
295
296
- def slugify(text) when is_binary(text) do
+ def slugify(text, replace \\ "-")
297
+
298
+ def slugify(text, replace) when is_binary(text) do
299
text
300
|> String.downcase()
301
|> String.trim()
302
|> String.normalize(:nfd)
303
|> String.replace(~r/[^a-z0-9\s-]/u, " ")
- |> String.replace(~r/[\s-]+/, "-", global: true)
304
+ |> String.replace(~r/[\s-]+/, replace, global: true)
305
306
- def slugify(_), do: ""
307
+ def slugify(_, _), do: ""
308
0 commit comments