Changeset 402
- Timestamp:
- 01/31/08 12:30:29 (10 months ago)
- Files:
-
- 1 modified
-
veekun/trunk/lib/Vee/BBCode.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
veekun/trunk/lib/Vee/BBCode.pm
r401 r402 32 32 # BUGS: 33 33 # - replace won't work with no_close 34 # - replace won't work when nested35 34 our %tags = ( 36 35 b => { param => 0, start => '<strong class="bbcode-b">', end => '</strong>' }, … … 85 84 for my $tag (keys %tags) { 86 85 if (exists $tags{$tag}{replace}) { 87 $input =~ s: (.*) \[ $tag \] (.+?) \[ / $tag \] : $1 . $tags{$tag}{replace}->(undef, $2) :gexis; 88 $input =~ s: (.*) \[ $tag = (.+?) \] (.+?) \[ / $tag \] : $1 . $tags{$tag}{replace}->($2, $3) :gexis; 86 while ($input =~ / \[ $tag ( = .+? )? \] /sx) { 87 # .* at the beginning ensures we catch innermost nestings first 88 $input =~ s: (.*) \[ $tag \] (.+?) \[ / $tag \] : $1 . $tags{$tag}{replace}->(undef, $2) :gexis; 89 $input =~ s: (.*) \[ $tag = (.+?) \] (.+?) \[ / $tag \] : $1 . $tags{$tag}{replace}->($2, $3) :gexis; 90 } 89 91 } else { 90 92 $input =~ s: \[ $tag \] : $tags{$tag}{start}->() :gexi;
