Sha256: 0751e0c81b4090e200f66598313d0341cc1f9a964dada9ce8c101deee3e3dace

Contents?: true

Size: 794 Bytes

Versions: 10

Compression:

Stored size: 794 Bytes

Contents

--FILE--
<?php
$env = new MtHaml\Environment('php', array(
    'enable_escaper' => true,
    'escape_attrs' => 'once',
));
echo $env->compileString($parts['HAML'], "$file.haml");
--HAML--
%html
    %body{:some=> "attr& #{$foo}"}
        %p{"#{$foo}" => "foo"}(z=$x)
            = "escaped"
            &= "escaped"
            != "not escaped"
--EXPECT--
<html>
  <body <?php echo MtHaml\Runtime::renderAttributes(array(array('some', ('attr& ' . $foo))), 'html5', 'UTF-8'); ?>>
    <p <?php echo MtHaml\Runtime::renderAttributes(array(array($foo, 'foo'), array('z', $x)), 'html5', 'UTF-8'); ?>>
      <?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
      <?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
      <?php echo "not escaped"; ?>
    </p>
  </body>
</html>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.3.1 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.3.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.5 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.4 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.3 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.2 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.1 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.2.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test
guard-mthaml-0.1.0 vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test