From 72d205bc36bb80f83bb19a59e05b7ab8b796afea Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 13 Jan 2025 14:40:40 +0100
Subject: [PATCH] Bug 38872: Parse all 'a' element, not only the first one

Test plan:
Apply the "Add test" commit
% prove t/template_filters.t
=> Fail
Apply this patch
% prove t/template_filters.t
=> Success
% prove xt/find-missing-filters.t
=> Fail
Apply the last patch "Fix occurrences"
% prove xt/find-missing-filters.t
=> Success

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
---
 t/lib/QA/TemplateFilters.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/lib/QA/TemplateFilters.pm b/t/lib/QA/TemplateFilters.pm
index 86aa034df3c..4f3825fbcc2 100644
--- a/t/lib/QA/TemplateFilters.pm
+++ b/t/lib/QA/TemplateFilters.pm
@@ -77,7 +77,7 @@ sub _process_tt_content {
               if $line =~ m{\[%(\s|-|~)*USE raw(\s|-|~)*%\]};    # Does [% Use raw %] exist?
 
             my $e;
-            if ( $line =~ qr{<a href="([^"]+)} ) {
+            while ( $line =~ m{<a href="([^"]+)}g ) {
                 my $to_uri_escape = $1;
                 while (
                     $to_uri_escape =~ m{
-- 
2.48.1