diff --git a/lib/pinchflat/utils/string_utils.ex b/lib/pinchflat/utils/string_utils.ex index bee23b50..49328b2c 100644 --- a/lib/pinchflat/utils/string_utils.ex +++ b/lib/pinchflat/utils/string_utils.ex @@ -25,23 +25,6 @@ defmodule Pinchflat.Utils.StringUtils do |> String.slice(0..(length - 1)) end - @doc """ - Truncates a string to the given length and adds `...` if the string is longer than the given length. - Will break on a word boundary. Nothing happens if the string is shorter than the given length. - - Returns binary() - """ - def truncate(string, length) do - if String.length(string) > length do - string - |> String.slice(0..(length - 1)) - |> String.replace(~r/\s+\S*$/, "") - |> Kernel.<>("...") - else - string - end - end - @doc """ Wraps a string in double braces. Useful as a UI helper now that LiveView 1.0.0 allows `{}` for interpolation so now we can't use braces diff --git a/lib/pinchflat_web/components/custom_components/button_components.ex b/lib/pinchflat_web/components/custom_components/button_components.ex index 9942ebcb..f1f3470c 100644 --- a/lib/pinchflat_web/components/custom_components/button_components.ex +++ b/lib/pinchflat_web/components/custom_components/button_components.ex @@ -26,7 +26,7 @@ defmodule PinchflatWeb.CustomComponents.ButtonComponents do ~H"""