[Jifty-commit] r2241 - Template-Declare/lib/Template/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Dec 1 00:19:18 EST 2006
Author: audreyt
Date: Fri Dec 1 00:19:18 2006
New Revision: 2241
Modified:
Template-Declare/lib/Template/Declare/Tags.pm
Log:
* Template::Declare::Tags - More uniform treatment of hiding &base.
Modified: Template-Declare/lib/Template/Declare/Tags.pm
==============================================================================
--- Template-Declare/lib/Template/Declare/Tags.pm (original)
+++ Template-Declare/lib/Template/Declare/Tags.pm Fri Dec 1 00:19:18 2006
@@ -39,25 +39,29 @@
}
use constant TagAlternateSpelling => {
- Tr => 'row',
- td => 'cell',
+ Tr => 'row',
+ td => 'cell',
+ base => '', # Currently 'base' has no alternate spellings; simply ignore it
};
sub install_tag {
my $tag = shift;
- {
- no strict 'refs';
- my $name = (TagAlternateSpelling->{$tag} || $tag);
- *$name = sub (&) { local *__ANON__ = $tag; _tag(@_) };
+ my $name = $tag;
+
+ if (exists(TagAlternateSpelling->{$tag})) {
+ $name = TagAlternateSpelling->{$tag} or return;
}
- push @EXPORT, $tag;
+
+ push @EXPORT, $name;
+
+ no strict 'refs';
+ *$name = sub (&) { local *__ANON__ = $tag; _tag(@_) };
}
use CGI ();
our %TAGS = (
map { $_ => +{} }
- grep { !/^base$/ } # hiding base{...} because it conflicts with "use Foo -base;"
map { @$_ }
@CGI::EXPORT_TAGS{qw/:html2 :html3 :html4 :netscape :form/}
);
More information about the Jifty-commit
mailing list