OSDN Git Service
(root)
/
fswiki
/
fswiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Perl5.26以降における "{", "}" の正規表現検査時のエスケープ対応。
[fswiki/fswiki.git]
/
plugin
/
format
/
FormatBase.pm
diff --git
a/plugin/format/FormatBase.pm
b/plugin/format/FormatBase.pm
index
16c7bd0
..
b7eee15
100644
(file)
--- a/
plugin/format/FormatBase.pm
+++ b/
plugin/format/FormatBase.pm
@@
-25,15
+25,15
@@
sub convert_to_fswiki {
$self->{block_level} = 0;
foreach my $line (@lines){
$self->{block_level} = 0;
foreach my $line (@lines){
- if($line =~ /^
{{.+}
}$/){
+ if($line =~ /^
\{\{.+\}\
}$/){
$buf .= $line."\n";
next;
$buf .= $line."\n";
next;
- } elsif($line =~ /^
{
{.+$/){
+ } elsif($line =~ /^
\{\
{.+$/){
$self->{block_level}++;
$buf .= $line."\n";
next;
} elsif($self->{block_level} > 0){
$self->{block_level}++;
$buf .= $line."\n";
next;
} elsif($self->{block_level} > 0){
- if($line eq "
}
}"){
+ if($line eq "
\}\
}"){
$self->{block_level}--;
}
$buf .= $line."\n";
$self->{block_level}--;
}
$buf .= $line."\n";
@@
-57,10
+57,10
@@
sub convert_from_fswiki {
$self->{block_level} = 0;
foreach my $line (@lines){
$self->{block_level} = 0;
foreach my $line (@lines){
- if($line =~ /^
{{.+}
}$/){
+ if($line =~ /^
\{\{.+\}\
}$/){
$buf .= $line."\n";
next;
$buf .= $line."\n";
next;
- } elsif($line =~ /^
{
{.+$/){
+ } elsif($line =~ /^
\{\
{.+$/){
$self->{block_level}++;
$buf .= $line."\n";
next;
$self->{block_level}++;
$buf .= $line."\n";
next;