root/lang/perl6/Text-Trac/trunk/lib/Text/Trac/Parser/Inline/Strike.pm @ 11974

Revision 11974, 413 bytes (checked in by lyokato, 7 years ago)

lang/perl6/Text-Trac: 一年以上前に作った奴なので、最新のものでは動かないけど

Line 
1class Text::Trac::Parser::Inline::Strike;
2
3is Text::Trac::Parser::Inline;
4use Text::Trac::Grammar;
5
6has Regex $.pattern;
7has Str   $.name;
8
9method init($self: ) returns Void {
10    $.name    = 'strike';
11    $.pattern = rx/ <?strike> /;
12}
13
14method parse_inline(Str $line is copy) returns Str {
15    $line ~~ $.pattern or return $line;
16    $line ~~ s:g{ <strike> } = $/<strike>[0].fmt(q{<del>%s</del>});
17    $line;
18}
19
Note: See TracBrowser for help on using the browser.