Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Created July 9, 2009 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiyoh/143402 to your computer and use it in GitHub Desktop.
Save taiyoh/143402 to your computer and use it in GitHub Desktop.
diff --git a/lib/Text/MicroTemplate/Extended.pm b/lib/Text/MicroTemplate/Extended.pm
index d775b80..0474663 100644
--- a/lib/Text/MicroTemplate/Extended.pm
+++ b/lib/Text/MicroTemplate/Extended.pm
@@ -34,15 +34,17 @@ sub block {
code => \$code,
};
- my \$current_ref = \$$self->{package_name}::_MTREF;
- my \$block_ref = \$block->{context_ref};
-
- my \$rendered = \$\$current_ref;
- \$\$block_ref = '';
-
- my \$result = \$block->{code}->();
-
- \$\$current_ref = (\$rendered || '') . (\$result || '');
+ if (!context->{extends}) {
+ my \$current_ref = \$$self->{package_name}::_MTREF;
+ my \$block_ref = \$block->{context_ref};
+
+ my \$rendered = \$\$current_ref;
+ \$\$block_ref = '';
+
+ my \$result = \$block->{code}->();
+
+ \$\$current_ref = (\$rendered || '') . (\$result || '');
+ }
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment