vars_and_comments
Replace any "__VARIABLES__" with their content,
and strip "[comment]comment tags[/comment]" ICML
container tags.
|
Availability
This filter was introduced in version 5.4.0,
and is therefore not available for use with any earlier Interchange version.
|
Example
- [filter vars_and_comments]
- __KEVIN__ [comment]This is a comment[/comment]__WALSH__
- [/filter]
|
Results in:
Source code
sub {
my $val = shift;
shift;
my %allowed;
$allowed{lc $_} = 1 for @_;
$val =~ s{<(/?(\w[-\w]*)[\s>])}{ ($allowed{lc $2} ? '<' : '<') . $1 }ge;
return $val;
}
|