From f4980962ea509cee5a2b83267a5559208cbb393c Mon Sep 17 00:00:00 2001 From: igor-primo Date: Sun, 12 Jan 2025 11:50:31 -0300 Subject: [PATCH 1/2] Addresses the issue #4245, removes a few
s --- web/cgi-bin/missa/ordo.pl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/cgi-bin/missa/ordo.pl b/web/cgi-bin/missa/ordo.pl index 6ec6333fd77..9dba9783e57 100755 --- a/web/cgi-bin/missa/ordo.pl +++ b/web/cgi-bin/missa/ordo.pl @@ -85,6 +85,7 @@ sub resolve_refs { my @resolved_lines; # Array of blocks expanded from lines. my $merged_lines; # Preceding continued lines. + my $was_hancigitur = 0; #cycle by lines for (my $it = 0; $it < @t; $it++) { @@ -95,6 +96,8 @@ sub resolve_refs { # Should this line be joined to the next? Strip off the continuation # character as we check. my $merge_with_next = ($line =~ s/~$//); + my $is_communicantes = ($line =~ /communicantes/); + my $is_hancigitur = ($line =~ /hancigitur/); # The first batch of transformations are performed on the current # input line only. @@ -115,6 +118,26 @@ sub resolve_refs { } #for special chars } + # If &hancigitur does not expand to the rubric explaining + # the text for Octaves of Easter and of Pentecostes + # we should merge with the next line. + # Otherwise, as before, to preserve the usual logic of rubrics. + $is_hancigitur = $is_hancigitur && !($line =~ /Sabbato/); + + # In order to solve the communicantes issue, just remove + # the last
and merge with next. + if ($is_communicantes || $is_hancigitur) { + $line =~ s/\$//g; + $merge_with_next = 1; + } + + # But, then, we need the index for the current line + # in order to merge the result together with + # the line previous to &hancigitur. + if ($is_hancigitur) { + $was_hancigitur = $it; + } + #cross $line = setcross($line); @@ -196,6 +219,13 @@ sub resolve_refs { # Connect lines marked by tilde. if ($merge_with_next && $it < $#t) { $merged_lines .= $line . ' '; + } elsif ($it - 1 > 0 && $was_hancigitur == $it - 1) { + # If we are looking at the line after &hancigitur + # we merge the result of the expansion of &hancigitur + # (which in this case is probaly some spaces or newlines?), + # together with the line previous to &hancigitur and + # the current line. + $resolved_lines[-1] .= $merged_lines . $line . ' '; } else { push @resolved_lines, $merged_lines . $line; $merged_lines = ''; From 6844b54d96c87fe9d3deb12eb64e3fbdcbb6fdb9 Mon Sep 17 00:00:00 2001 From: igor-primo Date: Sun, 12 Jan 2025 11:57:27 -0300 Subject: [PATCH 2/2] style: forgot running perltidy, sorry --- web/cgi-bin/missa/ordo.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/web/cgi-bin/missa/ordo.pl b/web/cgi-bin/missa/ordo.pl index 9dba9783e57..640f9f18446 100755 --- a/web/cgi-bin/missa/ordo.pl +++ b/web/cgi-bin/missa/ordo.pl @@ -220,6 +220,7 @@ sub resolve_refs { if ($merge_with_next && $it < $#t) { $merged_lines .= $line . ' '; } elsif ($it - 1 > 0 && $was_hancigitur == $it - 1) { + # If we are looking at the line after &hancigitur # we merge the result of the expansion of &hancigitur # (which in this case is probaly some spaces or newlines?),