From 8de88fcf72343d28ad88a945883f1523eaa9358b Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 3 Apr 2025 18:30:18 +0100 Subject: [PATCH] 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 --- lib/music_library_web/live/artist_live/show.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/music_library_web/live/artist_live/show.ex b/lib/music_library_web/live/artist_live/show.ex index aaf731d0..bbf13d73 100644 --- a/lib/music_library_web/live/artist_live/show.ex +++ b/lib/music_library_web/live/artist_live/show.ex @@ -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/\.*\s*/ defp render_bio(bio) do - case String.split(bio, @last_fm_link_regex, include_captures: true) do + last_fm_link_regex = ~r/\.*\s*/ + + case String.split(bio, last_fm_link_regex, include_captures: true) do [text, link, ""] -> reformatted_bio = Enum.join(