LightnCandy option: FLAG_HBESCAPE

Align {{foo}} escaping logic with handlebars.js. This causes ', = and ` be escaped in different way.

Sample Codes

The default escaping is by htmlentities only.

Data:
array(
  "foo" => "Love & <b>Peace</b>"
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Love & <b>Peace</b>"
);
echo $render($data);

Escaping ':

Data:
array(
  "foo" => "Single Quote is '"
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Single Quote is '"
);
echo $render($data);

Escaping ':

Used option: FLAG_HBESCAPE

Data:
array(
  "foo" => "Single Quote is '"
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_HBESCAPE
));
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Single Quote is '"
);
echo $render($data);

Escaping `:

Data:
array(
  "foo" => "Backtick is `"
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Backtick is `"
);
echo $render($data);

Escaping `:

Used option: FLAG_HBESCAPE

Data:
array(
  "foo" => "Backtick is `"
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_HBESCAPE
));
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Backtick is `"
);
echo $render($data);

Escaping =:

Data:
array(
  "foo" => "Equal is ="
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template);
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Equal is ="
);
echo $render($data);

Escaping =:

Used option: FLAG_HBESCAPE

Data:
array(
  "foo" => "Equal is ="
)
Template:
{{foo}}
Result:
Command failed: php .exec_tmp_file 2>/dev/null
Source Code
require('./vendor/autoload.php');
use LightnCandy\LightnCandy;
$template = "{{foo}}";

$php = LightnCandy::compile($template, array(
  "flags" => LightnCandy::FLAG_HBESCAPE
));
$render = LightnCandy::prepare($php);
$data = array(
  "foo" => "Equal is ="
);
echo $render($data);