File Coverage

blib/lib/WWW/Shopify/Liquid/Filter/NewlineToBr.pm
Criterion Covered Total %
statement 9 13 69.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 20 60.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 37     37   14904 use strict;
  37         113  
  37         1164  
3 37     37   237 use warnings;
  37         100  
  37         1481  
4              
5 37     37   256 package WWW::Shopify::Liquid::Filter::NewlineToBr; use base 'WWW::Shopify::Liquid::Filter';
  37         101  
  37         6764  
6             sub operate {
7 0     0 0   my $str = $_[2];
8 0 0         $str = '' unless defined $str;
9 0           $str =~ s/(\r\n|\n|\r)/<br\/>/g;
10 0           return $str;
11             }
12              
13             1;