fix($interpolate): always unescape escaped interpolation markers#14199
fix($interpolate): always unescape escaped interpolation markers#14199gkalpak wants to merge 1 commit intoangular:masterfrom
Conversation
Previously, whenever `mustHaveExpression` was true (e.g. when compiling a text node), `$interpolate` would not unescape the escaped interpolation markers if there were no actual interpolation expressions in the same string. This commit fixes the problem, by always unescaping the escaped markers (if any). Due to always checking for the presence of escaped interpolation markers, there is a slight performance hit. Fixes angular#14196
|
This PR brings a new level of complexity when people want to have the This is, we should unescape everything (not only On Tuesday, March 8, 2016, Georgios Kalpakas notifications@github.com
|
|
Maybe I didn't understand well, but with the current behavior, |
|
@gkalpak agree, but this PR moves the issue from one pattern to another :) |
|
I think this looks good to me. The issue that @lgalfaso points out is already a problem for text blocks that contain interpolation expressions anyway. This just brings consistency between blocks that do and do not contain interpolation expressions. |
|
Breaking change? Well at the moment I would argue that the escaping is broken, since it is inconsistent and I doubt that anyone is really relying on these escaped sequences not being unescaped in text blocks that do not contain interpolation expressions. |
|
@petebacondarwin if this PR lands, how would you write |
|
I am not sure. But however you do it after this PR it will be the same as you would do it before the PR, in the case that there was some interpolated expression in the same text block. One ugly way would be to do... |
|
I think everybody agrees that the current is less than ideal. I would not On Wednesday, March 9, 2016, Pete Bacon Darwin notifications@github.com
|

Previously, whenever
mustHaveExpressionwas true (e.g. when compiling a text node),$interpolatewould not unescape the escaped interpolation markers if there were no actualinterpolation expressions in the same string.
This commit fixes the problem, by always unescaping the escaped markers (if any).
Due to always checking for the presence of escaped interpolation markers, there is a slight
performance hit.
Fixes #14196