<commit_before>package Pod::POM::View::InlineHTML;
use base qw( Pod::POM::View::HTML );

use Modern::Perl;

my @OVER;



sub new {
    my $class = shift;
    my %args  = @_;
    
    my $self  = $class->SUPER::new(@_)
                or return;
    
    $self->{'base_header_level'} = $args{'header_level'} 
                                   // 1;
    
    {
        no warnings;
        
        # must be an number
        $self->{'base_header_level'} = 0
            unless int( $self->{'base_header_level'} ) > 0;
    }
    
    return $self;
}


# not generating an HTML page, just a fragment, so no surrounding bumph
sub view_pod {
    my $self = shift;
    my $pod  = shift;
    
    return $pod->content->present( $self );
}

# allow the base header level to be set contextually in the constructor
# (so =head1 can actually be an H2, or H3 etc)
sub view_header {
    my $self   = shift;
    my $header = shift;
    my $level  = shift() + $self->{'base_header_level'};
    
    $level = 6 
        if $level > 6;
    $level = 1
        if $level < 1;
    
    my $title = $header->title->present( $self );
    my $id    = generate_id( $title );
    my $tag   = "h${level}";
    
    return "<${tag} id='${id}'>$title</${tag}>\n"
           . $header->content->present($self);
}
sub view_head1 {
    my $self = shift;
    return $self->view_header( shift, 0 );
}
sub view_head2 {
    my $self  = shift;
    return $self->view_header( shift, 0 );
}
sub view_head3 {
    my $self  = shift;
    return $self->view_header( shift, 0 );
}
sub view_head4 {
    my $self  = shift;
    return $self->view_header( shift, 0 );
}

# don't want anchors on list items
sub view_item {
    my $self = shift;
    my $item = shift;
    
    my $over    = ref $self ? $self->{ OVER } : \@OVER;
    my $strip   = $over->[-1];
    my $title   = $item->title();
    my $content = $item->content->present( $self );
    <commit_msg>Fix header levels in the custom HTML renderer.<commit_after>package Pod::POM::View::InlineHTML;
use base qw( Pod::POM::View::HTML );

use Modern::Perl;

my @OVER;



sub new {
    my $class = shift;
    my %args  = @_;
    
    my $self  = $class->SUPER::new(@_)
                or return;
    
    $self->{'base_header_level'} = $args{'header_level'} 
                                   // 1;
    
    {
        no warnings;
        
        # must be an number
        $self->{'base_header_level'} = 0
            unless int( $self->{'base_header_level'} ) > 0;
    }
    
    return $self;
}


# not generating an HTML page, just a fragment, so no surrounding bumph
sub view_pod {
    my $self = shift;
    my $pod  = shift;
    
    return $pod->content->present( $self );
}

# allow the base header level to be set contextually in the constructor
# (so =head1 can actually be an H2, or H3 etc)
sub view_header {
    my $self   = shift;
    my $header = shift;
    my $level  = shift() + $self->{'base_header_level'};
    
    $level = 6 
        if $level > 6;
    $level = 1
        if $level < 1;
    
    my $title = $header->title->present( $self );
    my $id    = generate_id( $title );
    my $tag   = "h${level}";
    
    return "<${tag} id='${id}'>$title</${tag}>\n"
           . $header->content->present($self);
}
sub view_head1 {
    my $self = shift;
    return $self->view_header( shift, 0 );
}
sub view_head2 {
    my $self  = shift;
    return $self->view_header( shift, 1 );
}
sub view_head3 {
    my $self  = shift;
    return $self->view_header( shift, 2 );
}
sub view_head4 {
    my $self  = shift;
    return $self->view_header( shift, 3 );
}

# don't want anchors on list items
sub view_item {
    my $self = shift;
    my $item = shift;
    
    my $over    = ref $self ? $self->{ OVER } : \@OVER;
    my $strip   = $over->[-1];
    my $title   = $item->title();
    my $content = $item->content->present( $self );
    
{'fraction_non_alphanumeric': 0.15350763655190267, 'fraction_numerical': 0.00983691431529899, 'mean_word_length': 2.103614457831325, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4323438', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1332, 'n_words': 383}