File: Hr.pm

package info (click to toggle)
libtext-trac-perl 0.12-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 320 kB
  • ctags: 234
  • sloc: perl: 2,742; makefile: 40
file content (23 lines) | stat: -rwxr-xr-x 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package Text::Trac::Hr;

use strict;
use base qw(Text::Trac::BlockNode);

sub init {
    my $self = shift;
    $self->pattern(qr/^----$/xms);
    return $self;
}

sub parse {
    my ( $self, $l ) = @_;
    my $c = $self->context;
    my $pattern = $self->pattern;
    $l =~ $pattern or return;

    $l =~ s{ $pattern }{<hr />}xmsg;

    $c->htmllines($l);
}

1;