Don't use a module attribute for the regex

As this will stop working with OTP28, see:

https://github.com/elixir-lang/elixir/pull/14381
This commit is contained in:
Claudio Ortolina
2025-04-03 18:30:18 +01:00
parent c82f197b60
commit 8de88fcf72
@@ -61,9 +61,10 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
# Bios start with text, then a link to read more on Last.fm, followed by a license text.
# We split the bio at the read more link in order to render the license separately.
@last_fm_link_regex ~r/<a.*Read more on Last\.fm<\/a>\.*\s*/
defp render_bio(bio) do
case String.split(bio, @last_fm_link_regex, include_captures: true) do
last_fm_link_regex = ~r/<a.*Read more on Last\.fm<\/a>\.*\s*/
case String.split(bio, last_fm_link_regex, include_captures: true) do
[text, link, ""] ->
reformatted_bio =
Enum.join(