fix(compiler): fix interpolation regexp
- Fix the interpolation regexp to match newline characters (i.e. `\n` and `\r`) Closes #6056
This commit is contained in:
parent
995a9e0cf8
commit
9b0e10e9a7
|
@ -49,7 +49,7 @@ import {
|
||||||
|
|
||||||
var _implicitReceiver = new ImplicitReceiver();
|
var _implicitReceiver = new ImplicitReceiver();
|
||||||
// TODO(tbosch): Cannot make this const/final right now because of the transpiler...
|
// TODO(tbosch): Cannot make this const/final right now because of the transpiler...
|
||||||
var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g;
|
var INTERPOLATION_REGEXP = /\{\{([\s\S]*?)\}\}/g;
|
||||||
|
|
||||||
class ParseException extends BaseException {
|
class ParseException extends BaseException {
|
||||||
constructor(message: string, input: string, errLocation: string, ctxLocation?: any) {
|
constructor(message: string, input: string, errLocation: string, ctxLocation?: any) {
|
||||||
|
|
|
@ -421,6 +421,10 @@ export function main() {
|
||||||
|
|
||||||
it('should parse conditional expression',
|
it('should parse conditional expression',
|
||||||
() => { checkInterpolation('{{ a < b ? a : b }}'); });
|
() => { checkInterpolation('{{ a < b ? a : b }}'); });
|
||||||
|
|
||||||
|
it('should parse expression with newline characters', () => {
|
||||||
|
checkInterpolation(`{{ 'foo' +\n 'bar' +\r 'baz' }}`, `{{ "foo" + "bar" + "baz" }}`);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("parseSimpleBinding", () => {
|
describe("parseSimpleBinding", () => {
|
||||||
|
|
Loading…
Reference in New Issue