Don\'t escape html from blocks, removing unneeded variable assigns

This commit is contained in:
Dan Miller
2014-04-14 19:51:42 +00:00
parent 56713e560f
commit f4e992119e
+3 -5
View File
@@ -211,9 +211,9 @@ class Mustache_Compiler
}
const BLOCK_VAR = '
$value = $this->resolveValue($context->%s(%s), $context, $indent);
$value = $this->resolveValue($context->findInBlock(%s), $context, $indent);
if($value && !is_array($value) && !is_object($value)) {
$buffer .= %s;
$buffer .= $value;
} else {
%s
}
@@ -221,11 +221,9 @@ class Mustache_Compiler
private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level)
{
$method = 'findInBlock';
$id_str = var_export($id, true);
$value = $this->getEscape();
return sprintf($this->prepare(self::BLOCK_VAR, $level), $method, $id_str, $value, $this->walk($nodes, 2));
return sprintf($this->prepare(self::BLOCK_VAR, $level), $id_str, $this->walk($nodes, 2));
}
const BLOCK_ARG = '