| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/HTMLStream.pm |
| Statements | Executed 27 statements in 9.02ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 10.2ms | 20.1ms | Markdent::Role::HTMLStream::BEGIN@9 |
| 1 | 1 | 1 | 4.90ms | 39.8ms | Markdent::Role::HTMLStream::BEGIN@15 |
| 1 | 1 | 1 | 52µs | 52µs | Markdent::Role::HTMLStream::BEGIN@2 |
| 1 | 1 | 1 | 49µs | 30.6ms | Markdent::Role::HTMLStream::BEGIN@10 |
| 1 | 1 | 1 | 41µs | 218µs | Markdent::Role::HTMLStream::BEGIN@17 |
| 1 | 1 | 1 | 40µs | 13.6ms | Markdent::Role::HTMLStream::BEGIN@18 |
| 1 | 1 | 1 | 40µs | 58µs | Markdent::Role::HTMLStream::BEGIN@6 |
| 1 | 1 | 1 | 39µs | 107µs | Markdent::Role::HTMLStream::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::__ANON__[:36] |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::auto_link |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_blockquote |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_code |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_emphasis |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_header |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_html_tag |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_link |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_list_item |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_ordered_list |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_paragraph |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_strong |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_table |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_table_body |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_table_cell |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_table_header |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_table_row |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::end_unordered_list |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::horizontal_rule |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::html_block |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::html_comment |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::html_comment_block |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::html_entity |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::html_tag |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::image |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::preformatted |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_blockquote |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_code |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_emphasis |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_header |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_html_tag |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_link |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_list_item |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_ordered_list |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_paragraph |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_strong |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_table |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_table_body |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_table_cell |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_table_header |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_table_row |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::start_unordered_list |
| 0 | 0 | 0 | 0s | 0s | Markdent::Role::HTMLStream::text |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Markdent::Role::HTMLStream; | ||||
| 2 | # spent 52µs within Markdent::Role::HTMLStream::BEGIN@2 which was called:
# once (52µs+0s) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 4 | ||||
| 3 | 1 | 29µs | $Markdent::Role::HTMLStream::VERSION = '0.17'; | ||
| 4 | 1 | 76µs | 1 | 52µs | } # spent 52µs making 1 call to Markdent::Role::HTMLStream::BEGIN@2 |
| 5 | |||||
| 6 | 3 | 95µs | 2 | 75µs | # spent 58µs (40+18) within Markdent::Role::HTMLStream::BEGIN@6 which was called:
# once (40µs+18µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 6 # spent 58µs making 1 call to Markdent::Role::HTMLStream::BEGIN@6
# spent 18µs making 1 call to strict::import |
| 7 | 3 | 99µs | 2 | 176µs | # spent 107µs (39+68) within Markdent::Role::HTMLStream::BEGIN@7 which was called:
# once (39µs+68µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 7 # spent 107µs making 1 call to Markdent::Role::HTMLStream::BEGIN@7
# spent 68µs making 1 call to warnings::import |
| 8 | |||||
| 9 | 3 | 852µs | 2 | 20.3ms | # spent 20.1ms (10.2+9.95) within Markdent::Role::HTMLStream::BEGIN@9 which was called:
# once (10.2ms+9.95ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 9 # spent 20.1ms making 1 call to Markdent::Role::HTMLStream::BEGIN@9
# spent 149µs making 1 call to Exporter::import |
| 10 | 1 | 30.5ms | # spent 30.6ms (49µs+30.5) within Markdent::Role::HTMLStream::BEGIN@10 which was called:
# once (49µs+30.5ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 # spent 30.5ms making 1 call to MooseX::Types::Combine::import | ||
| 11 | HeaderLevel Str Bool HashRef | ||||
| 12 | TableCellAlignment PosInt | ||||
| 13 | OutputStream | ||||
| 14 | 3 | 166µs | 1 | 30.6ms | ); # spent 30.6ms making 1 call to Markdent::Role::HTMLStream::BEGIN@10 |
| 15 | 3 | 698µs | 2 | 41.2ms | # spent 39.8ms (4.90+34.9) within Markdent::Role::HTMLStream::BEGIN@15 which was called:
# once (4.90ms+34.9ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 15 # spent 39.8ms making 1 call to Markdent::Role::HTMLStream::BEGIN@15
# spent 1.39ms making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756] |
| 16 | |||||
| 17 | 3 | 104µs | 2 | 394µs | # spent 218µs (41+177) within Markdent::Role::HTMLStream::BEGIN@17 which was called:
# once (41µs+177µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 17 # spent 218µs making 1 call to Markdent::Role::HTMLStream::BEGIN@17
# spent 177µs making 1 call to namespace::autoclean::import |
| 18 | 3 | 6.63ms | 2 | 27.2ms | # spent 13.6ms (40µs+13.6) within Markdent::Role::HTMLStream::BEGIN@18 which was called:
# once (40µs+13.6ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 18 # spent 13.6ms making 1 call to Markdent::Role::HTMLStream::BEGIN@18
# spent 13.6ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 19 | |||||
| 20 | 1 | 21µs | 1 | 56.9ms | with 'Markdent::Role::EventsAsMethods'; # spent 56.9ms making 1 call to Moose::Role::with |
| 21 | |||||
| 22 | 1 | 16µs | 1 | 518µs | requires qw( start_document end_document ); # spent 518µs making 1 call to Moose::Role::requires |
| 23 | |||||
| 24 | 1 | 25µs | 2 | 1.23ms | has _output => ( # spent 899µs making 1 call to Moose::Role::has
# spent 326µs making 1 call to __TYPE__::Markdent::Types::Internal::OutputStream |
| 25 | is => 'ro', | ||||
| 26 | isa => OutputStream, | ||||
| 27 | required => 1, | ||||
| 28 | init_arg => 'output', | ||||
| 29 | ); | ||||
| 30 | |||||
| 31 | has _stream => ( | ||||
| 32 | is => 'ro', | ||||
| 33 | isa => 'HTML::Stream', | ||||
| 34 | init_arg => undef, | ||||
| 35 | lazy => 1, | ||||
| 36 | default => sub { HTML::Stream->new( $_[0]->_output() ) }, | ||||
| 37 | 1 | 22µs | 1 | 666µs | ); # spent 666µs making 1 call to Moose::Role::has |
| 38 | |||||
| 39 | sub start_header { | ||||
| 40 | my $self = shift; | ||||
| 41 | my ($level) = validated_list( \@_, | ||||
| 42 | level => { isa => HeaderLevel }, | ||||
| 43 | ); | ||||
| 44 | |||||
| 45 | my $tag = 'h' . $level; | ||||
| 46 | |||||
| 47 | $self->_stream()->tag($tag); | ||||
| 48 | } | ||||
| 49 | |||||
| 50 | sub end_header { | ||||
| 51 | my $self = shift; | ||||
| 52 | my ($level) = validated_list( \@_, | ||||
| 53 | level => { isa => HeaderLevel }, | ||||
| 54 | ); | ||||
| 55 | |||||
| 56 | my $tag = '_h' . $level; | ||||
| 57 | |||||
| 58 | $self->_stream()->tag($tag); | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | sub start_blockquote { | ||||
| 62 | my $self = shift; | ||||
| 63 | |||||
| 64 | $self->_stream()->tag('blockquote'); | ||||
| 65 | } | ||||
| 66 | |||||
| 67 | sub end_blockquote { | ||||
| 68 | my $self = shift; | ||||
| 69 | |||||
| 70 | $self->_stream()->tag('_blockquote'); | ||||
| 71 | } | ||||
| 72 | |||||
| 73 | sub start_unordered_list { | ||||
| 74 | my $self = shift; | ||||
| 75 | |||||
| 76 | $self->_stream()->tag('ul'); | ||||
| 77 | } | ||||
| 78 | |||||
| 79 | sub end_unordered_list { | ||||
| 80 | my $self = shift; | ||||
| 81 | |||||
| 82 | $self->_stream()->tag('_ul'); | ||||
| 83 | } | ||||
| 84 | |||||
| 85 | sub start_ordered_list { | ||||
| 86 | my $self = shift; | ||||
| 87 | |||||
| 88 | $self->_stream()->tag('ol'); | ||||
| 89 | } | ||||
| 90 | |||||
| 91 | sub end_ordered_list { | ||||
| 92 | my $self = shift; | ||||
| 93 | |||||
| 94 | $self->_stream()->tag('_ol'); | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | sub start_list_item { | ||||
| 98 | my $self = shift; | ||||
| 99 | |||||
| 100 | $self->_stream()->tag('li'); | ||||
| 101 | } | ||||
| 102 | |||||
| 103 | sub end_list_item { | ||||
| 104 | my $self = shift; | ||||
| 105 | |||||
| 106 | $self->_stream()->tag('_li'); | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | sub preformatted { | ||||
| 110 | my $self = shift; | ||||
| 111 | my ($text) = validated_list( \@_, text => { isa => Str }, ); | ||||
| 112 | |||||
| 113 | $self->_stream()->tag('pre'); | ||||
| 114 | $self->_stream()->tag('code'); | ||||
| 115 | $self->_stream()->text($text); | ||||
| 116 | $self->_stream()->tag('_code'); | ||||
| 117 | $self->_stream()->tag('_pre'); | ||||
| 118 | } | ||||
| 119 | |||||
| 120 | sub start_paragraph { | ||||
| 121 | my $self = shift; | ||||
| 122 | |||||
| 123 | $self->_stream()->tag('p'); | ||||
| 124 | } | ||||
| 125 | |||||
| 126 | sub end_paragraph { | ||||
| 127 | my $self = shift; | ||||
| 128 | |||||
| 129 | $self->_stream()->tag('_p'); | ||||
| 130 | } | ||||
| 131 | |||||
| 132 | sub start_table { | ||||
| 133 | my $self = shift; | ||||
| 134 | my ($caption) = validated_list( | ||||
| 135 | \@_, | ||||
| 136 | caption => { isa => Str, optional => 1 }, | ||||
| 137 | ); | ||||
| 138 | |||||
| 139 | $self->_stream()->tag('table'); | ||||
| 140 | |||||
| 141 | if ( defined $caption && length $caption ) { | ||||
| 142 | $self->_stream()->tag('caption'); | ||||
| 143 | $self->_stream()->text($caption); | ||||
| 144 | $self->_stream()->tag('_caption'); | ||||
| 145 | } | ||||
| 146 | } | ||||
| 147 | |||||
| 148 | sub end_table { | ||||
| 149 | my $self = shift; | ||||
| 150 | |||||
| 151 | $self->_stream()->tag('_table'); | ||||
| 152 | } | ||||
| 153 | |||||
| 154 | sub start_table_header { | ||||
| 155 | my $self = shift; | ||||
| 156 | |||||
| 157 | $self->_stream()->tag('thead'); | ||||
| 158 | } | ||||
| 159 | |||||
| 160 | sub end_table_header { | ||||
| 161 | my $self = shift; | ||||
| 162 | |||||
| 163 | $self->_stream()->tag('_thead'); | ||||
| 164 | } | ||||
| 165 | |||||
| 166 | sub start_table_body { | ||||
| 167 | my $self = shift; | ||||
| 168 | |||||
| 169 | $self->_stream()->tag('tbody'); | ||||
| 170 | } | ||||
| 171 | |||||
| 172 | sub end_table_body { | ||||
| 173 | my $self = shift; | ||||
| 174 | |||||
| 175 | $self->_stream()->tag('_tbody'); | ||||
| 176 | } | ||||
| 177 | |||||
| 178 | sub start_table_row { | ||||
| 179 | my $self = shift; | ||||
| 180 | |||||
| 181 | $self->_stream()->tag('tr'); | ||||
| 182 | } | ||||
| 183 | |||||
| 184 | sub end_table_row { | ||||
| 185 | my $self = shift; | ||||
| 186 | |||||
| 187 | $self->_stream()->tag('_tr'); | ||||
| 188 | } | ||||
| 189 | |||||
| 190 | sub start_table_cell { | ||||
| 191 | my $self = shift; | ||||
| 192 | my ( $alignment, $colspan, $is_header ) = validated_list( | ||||
| 193 | \@_, | ||||
| 194 | alignment => { isa => TableCellAlignment, optional => 1 }, | ||||
| 195 | colspan => { isa => PosInt }, | ||||
| 196 | is_header_cell => { isa => Bool }, | ||||
| 197 | ); | ||||
| 198 | |||||
| 199 | my $tag = $is_header ? 'th' : 'td'; | ||||
| 200 | |||||
| 201 | my %attr = ( align => $alignment ); | ||||
| 202 | $attr{colspan} = $colspan | ||||
| 203 | if $colspan != 1; | ||||
| 204 | |||||
| 205 | $self->_stream()->tag( $tag, %attr ); | ||||
| 206 | } | ||||
| 207 | |||||
| 208 | sub end_table_cell { | ||||
| 209 | my $self = shift; | ||||
| 210 | my ($is_header) = validated_hash( | ||||
| 211 | \@_, | ||||
| 212 | is_header_cell => { isa => Bool }, | ||||
| 213 | ); | ||||
| 214 | |||||
| 215 | $self->_stream()->tag( $is_header ? '_th' : '_td' ); | ||||
| 216 | } | ||||
| 217 | |||||
| 218 | sub start_emphasis { | ||||
| 219 | my $self = shift; | ||||
| 220 | |||||
| 221 | $self->_stream()->tag('em'); | ||||
| 222 | } | ||||
| 223 | |||||
| 224 | sub end_emphasis { | ||||
| 225 | my $self = shift; | ||||
| 226 | |||||
| 227 | $self->_stream()->tag('_em'); | ||||
| 228 | } | ||||
| 229 | |||||
| 230 | sub start_strong { | ||||
| 231 | my $self = shift; | ||||
| 232 | |||||
| 233 | $self->_stream()->tag('strong'); | ||||
| 234 | } | ||||
| 235 | |||||
| 236 | sub end_strong { | ||||
| 237 | my $self = shift; | ||||
| 238 | |||||
| 239 | $self->_stream()->tag('_strong'); | ||||
| 240 | } | ||||
| 241 | |||||
| 242 | sub start_code { | ||||
| 243 | my $self = shift; | ||||
| 244 | |||||
| 245 | $self->_stream()->tag('code'); | ||||
| 246 | } | ||||
| 247 | |||||
| 248 | sub end_code { | ||||
| 249 | my $self = shift; | ||||
| 250 | |||||
| 251 | $self->_stream()->tag('_code'); | ||||
| 252 | } | ||||
| 253 | |||||
| 254 | sub auto_link { | ||||
| 255 | my $self = shift; | ||||
| 256 | my ($uri) = validated_list( | ||||
| 257 | \@_, | ||||
| 258 | uri => { isa => Str, optional => 1 }, | ||||
| 259 | ); | ||||
| 260 | |||||
| 261 | $self->_stream()->tag( 'a', href => $uri ); | ||||
| 262 | $self->_stream()->text($uri); | ||||
| 263 | $self->_stream()->tag('_a'); | ||||
| 264 | } | ||||
| 265 | |||||
| 266 | sub start_link { | ||||
| 267 | my $self = shift; | ||||
| 268 | my %p = validated_hash( | ||||
| 269 | \@_, | ||||
| 270 | uri => { isa => Str }, | ||||
| 271 | title => { isa => Str, optional => 1 }, | ||||
| 272 | id => { isa => Str, optional => 1 }, | ||||
| 273 | is_implicit_id => { isa => Bool, optional => 1 }, | ||||
| 274 | ); | ||||
| 275 | |||||
| 276 | delete @p{ grep { ! defined $p{$_} } keys %p }; | ||||
| 277 | |||||
| 278 | $self->_stream()->tag( | ||||
| 279 | 'a', href => $p{uri}, | ||||
| 280 | exists $p{title} ? ( title => $p{title} ) : (), | ||||
| 281 | ); | ||||
| 282 | } | ||||
| 283 | |||||
| 284 | sub end_link { | ||||
| 285 | my $self = shift; | ||||
| 286 | |||||
| 287 | $self->_stream()->tag('_a'); | ||||
| 288 | } | ||||
| 289 | |||||
| 290 | sub text { | ||||
| 291 | my $self = shift; | ||||
| 292 | my ($text) = validated_list( \@_, text => { isa => Str }, ); | ||||
| 293 | |||||
| 294 | $self->_stream()->text($text); | ||||
| 295 | } | ||||
| 296 | |||||
| 297 | sub start_html_tag { | ||||
| 298 | my $self = shift; | ||||
| 299 | my ( $tag, $attributes ) = validated_list( | ||||
| 300 | \@_, | ||||
| 301 | tag => { isa => Str }, | ||||
| 302 | attributes => { isa => HashRef }, | ||||
| 303 | ); | ||||
| 304 | |||||
| 305 | $self->_stream()->tag( $tag, %{$attributes} ); | ||||
| 306 | } | ||||
| 307 | |||||
| 308 | sub html_comment_block { | ||||
| 309 | my $self = shift; | ||||
| 310 | my ($text) = validated_list( | ||||
| 311 | \@_, | ||||
| 312 | text => { isa => Str }, | ||||
| 313 | ); | ||||
| 314 | |||||
| 315 | # HTML::Stream->comment() adds extra whitespace for no good reason. | ||||
| 316 | $self->_output()->print( '<!--' . $text . '-->' . "\n" ); | ||||
| 317 | } | ||||
| 318 | |||||
| 319 | sub html_comment { | ||||
| 320 | my $self = shift; | ||||
| 321 | my ($text) = validated_list( | ||||
| 322 | \@_, | ||||
| 323 | text => { isa => Str }, | ||||
| 324 | ); | ||||
| 325 | |||||
| 326 | # HTML::Stream->comment() adds extra whitespace for no good reason. | ||||
| 327 | $self->_output()->print( '<!--' . $text . '-->' ); | ||||
| 328 | } | ||||
| 329 | |||||
| 330 | sub html_tag { | ||||
| 331 | my $self = shift; | ||||
| 332 | my ( $tag, $attributes ) = validated_list( | ||||
| 333 | \@_, | ||||
| 334 | tag => { isa => Str }, | ||||
| 335 | attributes => { isa => HashRef }, | ||||
| 336 | ); | ||||
| 337 | |||||
| 338 | $self->_stream()->tag( $tag, %{$attributes} ); | ||||
| 339 | } | ||||
| 340 | |||||
| 341 | sub end_html_tag { | ||||
| 342 | my $self = shift; | ||||
| 343 | my ($tag) = validated_list( | ||||
| 344 | \@_, | ||||
| 345 | tag => { isa => Str }, | ||||
| 346 | ); | ||||
| 347 | |||||
| 348 | $self->_stream()->tag( q{_} . $tag ); | ||||
| 349 | } | ||||
| 350 | |||||
| 351 | sub html_entity { | ||||
| 352 | my $self = shift; | ||||
| 353 | my ($entity) = validated_list( \@_, entity => { isa => Str }, ); | ||||
| 354 | |||||
| 355 | $self->_stream()->ent($entity); | ||||
| 356 | } | ||||
| 357 | |||||
| 358 | sub html_block { | ||||
| 359 | my $self = shift; | ||||
| 360 | my ($html) = validated_list( \@_, html => { isa => Str }, ); | ||||
| 361 | |||||
| 362 | $self->_output()->print($html); | ||||
| 363 | } | ||||
| 364 | |||||
| 365 | sub image { | ||||
| 366 | my $self = shift; | ||||
| 367 | my %p = validated_hash( | ||||
| 368 | \@_, | ||||
| 369 | alt_text => { isa => Str }, | ||||
| 370 | uri => { isa => Str, optional => 1 }, | ||||
| 371 | title => { isa => Str, optional => 1 }, | ||||
| 372 | id => { isa => Str, optional => 1 }, | ||||
| 373 | is_implicit_id => { isa => Bool, optional => 1 }, | ||||
| 374 | ); | ||||
| 375 | |||||
| 376 | delete @p{ grep { ! defined $p{$_} } keys %p }; | ||||
| 377 | |||||
| 378 | $self->_stream()->tag( | ||||
| 379 | 'img', src => $p{uri}, | ||||
| 380 | ( exists $p{alt_text} ? ( alt => $p{alt_text} ) : () ), | ||||
| 381 | ( exists $p{title} ? ( title => $p{title} ) : () ), | ||||
| 382 | ); | ||||
| 383 | } | ||||
| 384 | |||||
| 385 | sub horizontal_rule { | ||||
| 386 | my $self = shift; | ||||
| 387 | |||||
| 388 | $self->_stream()->tag('hr'); | ||||
| 389 | } | ||||
| 390 | |||||
| 391 | 1 | 101µs | 1; | ||
| 392 | |||||
| 393 | # ABSTRACT: A role for handlers which generate HTML | ||||
| 394 | |||||
| - - | |||||
| 397 | =pod | ||||
| 398 | |||||
| - - | |||||
| 440 | 1 | 85µs | 1 | 40.2ms | __END__ # spent 40.2ms making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26] |