From 5b0346b34ceefa6eb889fa0e753cd7a3a6db69ac Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Mon, 4 Jun 2012 20:46:07 -0700 Subject: [PATCH] Remove Handlebars._escape `&` heuristic. It made strings like "Escape < as <" unrenderable. --- packages/handlebars/evaluate.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/handlebars/evaluate.js b/packages/handlebars/evaluate.js index 736bb6b542..8119366c41 100644 --- a/packages/handlebars/evaluate.js +++ b/packages/handlebars/evaluate.js @@ -70,10 +70,7 @@ Handlebars._escape = (function() { }; return function (x) { - // If Handlebars sees an &entity; in the input text, it won't quote - // it (won't replace it with &entity;). I'm not sure if that's - // the right choice -- it's definitely a heuristic.. - return x.replace(/&(?!\w+;)|[<>"'`]/g, escape_one); + return x.replace(/[&<>"'`]/g, escape_one); }; })();