Perl5.26以降における "{", "}" の正規表現検査時のエスケープ対応。
@@ -89,7 +89,7 @@ | ||
89 | 89 | } |
90 | 90 | |
91 | 91 | # パラグラフプラグイン |
92 | - if($line =~ /^{{(.+}})$/){ | |
92 | + if($line =~ /^\{\{(.+\}\})$/){ | |
93 | 93 | if(!$self->{block}){ |
94 | 94 | my $plugin = $self->{wiki}->parse_inline_plugin($1); |
95 | 95 | my $info = $self->{wiki}->get_plugin_info($plugin->{command}); |
@@ -101,7 +101,7 @@ | ||
101 | 101 | } |
102 | 102 | next; |
103 | 103 | } |
104 | - } elsif($line =~ /^{{(.+)$/){ | |
104 | + } elsif($line =~ /^\{\{(.+)$/){ | |
105 | 105 | if ($self->{block}) { |
106 | 106 | my $plugin = $self->{wiki}->parse_inline_plugin($1); |
107 | 107 | my $info = $self->{wiki}->get_plugin_info($plugin->{command}); |
@@ -282,7 +282,7 @@ | ||
282 | 282 | while ($source ne q{}) { |
283 | 283 | |
284 | 284 | # どのインライン Wiki 書式の先頭にも match しない場合 |
285 | - if (!($source =~ /^(.*?)((?:{{|\[\[?|https?:|mailto:|f(?:tp:|ile:)|'''?|==|__|<<).*)$/)) { | |
285 | + if (!($source =~ /^(.*?)((?:\{\{|\[\[?|https?:|mailto:|f(?:tp:|ile:)|'''?|==|__|<<).*)$/)) { | |
286 | 286 | # キーワード検索・置換処理のみ実施して終了する |
287 | 287 | push @array, $self->_parse_line_keyword($pre . $source); |
288 | 288 | return @array; |
@@ -293,7 +293,7 @@ | ||
293 | 293 | @parsed = (); |
294 | 294 | |
295 | 295 | # プラグイン |
296 | - if ($source =~ /^{{/) { | |
296 | + if ($source =~ /^\{\{/) { | |
297 | 297 | $source = $'; |
298 | 298 | my $plugin = $self->{wiki}->parse_inline_plugin($source); |
299 | 299 | unless($plugin){ |
@@ -729,7 +729,7 @@ | ||
729 | 729 | my $text = shift; |
730 | 730 | my ($cmd, @args_tmp) = split(/ /,$text); |
731 | 731 | my $args_txt = &Util::trim(join(" ",@args_tmp)); |
732 | - if($cmd =~ s/}}(.*?)$//){ | |
732 | + if($cmd =~ s/\}\}(.*?)$//){ | |
733 | 733 | return { command=>$cmd, args=>[], post=>"$1 $args_txt"}; |
734 | 734 | } |
735 | 735 |
@@ -61,7 +61,7 @@ | ||
61 | 61 | |
62 | 62 | foreach(@lines){ |
63 | 63 | $content = $content.$_."\n"; |
64 | - if(/^{{bbs\s*.*}}$/ && $flag==0){ | |
64 | + if(/^\{\{bbs\s*.*\}\}$/ && $flag==0){ | |
65 | 65 | if($form_count==$count){ |
66 | 66 | $content .= "!!$subject - $name (".&Util::format_date(time()).")\n". |
67 | 67 | "$message\n"; |
@@ -102,7 +102,7 @@ | ||
102 | 102 | my @category; |
103 | 103 | foreach my $line (split(/\n/,$source)){ |
104 | 104 | if(index($line," ")!=0 && index($line,"\t")!=0 && index($line,"//")!=0){ |
105 | - while($line =~ /{{(category\s+(.+?)\s*}})/g){ | |
105 | + while($line =~ /\{\{(category\s+(.+?)\s*\}\})/g){ | |
106 | 106 | my $inline = $wiki->parse_inline_plugin($1); |
107 | 107 | if(@{$inline->{args}} > 1 and $inline->{args}->[-1] eq 'nolink'){ |
108 | 108 | pop @{$inline->{args}}; |
@@ -56,7 +56,7 @@ | ||
56 | 56 | # 新着順の場合 |
57 | 57 | if($option eq "reverse"){ |
58 | 58 | $content = $content.$_."\n"; |
59 | - if(/^{{comment\s*.*}}$/ && $flag==0){ | |
59 | + if(/^\{\{comment\s*.*\}\}$/ && $flag==0){ | |
60 | 60 | if($form_count==$count){ |
61 | 61 | $content = $content."*$message - $name (".Util::format_date(time()).")\n"; |
62 | 62 | $flag = 1; |
@@ -70,7 +70,7 @@ | ||
70 | 70 | |
71 | 71 | # 投稿順の場合 |
72 | 72 | } else { |
73 | - if(/^{{comment\s*.*}}$/ && $flag==0){ | |
73 | + if(/^\{\{comment\s*.*\}\}$/ && $flag==0){ | |
74 | 74 | if($form_count==$count){ |
75 | 75 | $content = $content."*$message - $name (".Util::format_date(time()).")\n"; |
76 | 76 | $flag = 1; |
@@ -105,7 +105,7 @@ | ||
105 | 105 | my $page = shift; |
106 | 106 | my @lines = split(/\n/,$wiki->get_page($page)); |
107 | 107 | foreach(@lines){ |
108 | - if(/^{{comment\s*.*}}$/){ | |
108 | + if(/^\{\{comment\s*.*\}\}$/){ | |
109 | 109 | return 1; |
110 | 110 | } |
111 | 111 | } |
@@ -25,15 +25,15 @@ | ||
25 | 25 | |
26 | 26 | $self->{block_level} = 0; |
27 | 27 | foreach my $line (@lines){ |
28 | - if($line =~ /^{{.+}}$/){ | |
28 | + if($line =~ /^\{\{.+\}\}$/){ | |
29 | 29 | $buf .= $line."\n"; |
30 | 30 | next; |
31 | - } elsif($line =~ /^{{.+$/){ | |
31 | + } elsif($line =~ /^\{\{.+$/){ | |
32 | 32 | $self->{block_level}++; |
33 | 33 | $buf .= $line."\n"; |
34 | 34 | next; |
35 | 35 | } elsif($self->{block_level} > 0){ |
36 | - if($line eq "}}"){ | |
36 | + if($line eq "\}\}"){ | |
37 | 37 | $self->{block_level}--; |
38 | 38 | } |
39 | 39 | $buf .= $line."\n"; |
@@ -57,10 +57,10 @@ | ||
57 | 57 | |
58 | 58 | $self->{block_level} = 0; |
59 | 59 | foreach my $line (@lines){ |
60 | - if($line =~ /^{{.+}}$/){ | |
60 | + if($line =~ /^\{\{.+\}\}$/){ | |
61 | 61 | $buf .= $line."\n"; |
62 | 62 | next; |
63 | - } elsif($line =~ /^{{.+$/){ | |
63 | + } elsif($line =~ /^\{\{.+$/){ | |
64 | 64 | $self->{block_level}++; |
65 | 65 | $buf .= $line."\n"; |
66 | 66 | next; |