View | Details | Raw Unified | Return to bug 33350
Collapse All | Expand All

(-)a/C4/Letters.pm (-9 / +31 lines)
Lines 635-648 sub GetPreparedLetter { Link Here
635
635
636
    if ($repeat_enclosing_tags) {
636
    if ($repeat_enclosing_tags) {
637
        while ( my ($tag, $tag_tables) = each %$repeat_enclosing_tags ) {
637
        while ( my ($tag, $tag_tables) = each %$repeat_enclosing_tags ) {
638
            if ( $letter->{content} =~ m!<$tag>(.*)</$tag>!s ) {
638
            my @lc_separated_1 = split(/<$tag>/, $letter->{content});
639
                my $subcontent = $1;
639
            my @lc_separated_final;
640
                my @lines = map {
640
            foreach my $lc1 (@lc_separated_1) {
641
                    my %subletter = ( title => '', content => $subcontent );
641
                if ( $lc1 =~ m!</$tag>!g) {
642
                    _substitute_tables( \%subletter, $_ );
642
                    my @lc_separated_2 = split(/<\/$tag>/, $lc1);
643
                    $subletter{content};
643
                    foreach my $lc2 (@lc_separated_2) {
644
                } @$tag_tables;
644
                        if ( $lc2 =~ m!"<<.*!g) {push(@lc_separated_final, "<".$tag.">".$lc2."</".$tag.">");
645
                $letter->{content} =~ s!<$tag>.*</$tag>!join( "\n", @lines )!se;
645
                        } else {
646
                            push(@lc_separated_final, $lc2);
647
                        }
648
                    }
649
                } else {
650
                    push(@lc_separated_final, $lc1);
651
                }
652
            }
653
            my @letter;
654
            if ( $letter->{content} =~ m!<$tag>(.*)</$tag>!s) {
655
                foreach my $subcontent (@lc_separated_final) {
656
                    if ($subcontent =~ m!<$tag>!g) {
657
                        my @lines = map {
658
                            my %subletter = ( title => '', content => $subcontent );
659
                            _substitute_tables( \%subletter, $_ );
660
                            $subletter{content};
661
                        } @$tag_tables;
662
                        push(@letter, @lines);
663
                    } else {
664
                        push(@letter, $subcontent);
665
                    }
666
                }
667
                my $string_letter = join( "\n", @letter );
668
                $letter->{content} = $string_letter;
646
            }
669
            }
647
        }
670
        }
648
    }
671
    }
649
- 

Return to bug 33350