| 1 | # This code is part of Perl distribution HTML-FromMail version 4.00. | ||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2003-2025 by Mark Overmeer. | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | package HTML::FromMail::Head;{ | ||||||||||||||||||||||||||||
| 13 | 1 | our $VERSION = '4.00'; | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use base 'HTML::FromMail::Page'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Log::Report 'html-frommail'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use HTML::FromMail::Field (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | #-------------------- | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | sub init($) | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | $args->{topic} ||= 'head'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"topic"} ||= "head"
MC/DC0%0/1
$args->{"topic"} ||= "head"
$args->{"topic"}
Truth table0%0/2
A
A= $args->{"topic"}
| |||||||||||||||||||||||||||||
| 30 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | #----------- | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | #----------- | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | sub fields($$) | ||||||||||||||||||||||||||||
| 38 | 0 | ▶ | { my ($thing, $realhead, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
fields: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 0 | my $head = $realhead->clone; # we are probably going to remove lines | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | my $lg = $args->{remove_list_group}; | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | $head->removeListGroup if $lg || !defined $lg; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$lg or not defined $lg
MC/DC0%0/2
$lg or not defined $lg
$lg
not defined $lg
Truth table0%0/3
A or not(B)
A= $lgB= not defined $lg
| |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | my $sg = $args->{remove_spam_groups}; | |||||||||||||||||||||||||||
| 45 | 0 | ▶ | $head->removeSpamGroups if $sg || !defined $sg; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sg or not defined $sg
MC/DC0%0/2
$sg or not defined $sg
$sg
not defined $sg
Truth table0%0/3
A or not(B)
A= $sgB= not defined $sg
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | my $rg = $args->{remove_resent_groups}; | |||||||||||||||||||||||||||
| 48 | 0 | ▶ | $head->removeResentGroups if $rg || !defined $rg; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rg or not defined $rg
MC/DC0%0/2
$rg or not defined $rg
$rg
not defined $rg
Truth table0%0/3
A or not(B)
A= $rgB= not defined $rg
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | my @fields; | |||||||||||||||||||||||||||
| 51 | 0 | ▶ | if(my $select = $args->{select}) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 52 | 0 | { my @select = split /\|/, $select; | |||||||||||||||||||||||||||
| 53 | 0 | @fields = map $head->grepNames($_), @select; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | elsif(my $ignore = $args->{ignore}) | ||||||||||||||||||||||||||||
| 56 | 0 | { my @ignore = split /\|/, $ignore; | |||||||||||||||||||||||||||
| 57 | 0 | local $" = ")|(?:"; | |||||||||||||||||||||||||||
| 58 | 0 | my $skip = qr/^(?:@ignore)/i; | |||||||||||||||||||||||||||
| 59 | 0 | @fields = grep $_->name !~ $skip, $head->orderedFields; | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | else | ||||||||||||||||||||||||||||
| 62 | 0 | { @fields = $head->orderedFields; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | map $_->study, @fields; | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 1 | 1; | |||||||||||||||||||||||||||