Skip to content

Commit

Permalink
fix: Allow to use spaces around bound key in complex attribute at par…
Browse files Browse the repository at this point in the history
…seBindings method
finom committed Oct 13, 2016

Verified

This commit was signed with the committer’s verified signature.
re-taro Rintaro Itokawa
1 parent ef22bf7 commit 7305c5f
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@ export default function defineHiddenContentProperty({

// create and cache regular expressions which will help us to
// change target property value quickly when sources are changed
// TODO: We need better parser!
for (let i = 0; i < keys.length; i++) {
regs[keys[i]] = new RegExp(escLeftBracket + keys[i] + escRightBracket, 'g');
regs[keys[i]] = new RegExp(`${escLeftBracket}\\s*${keys[i]}\\s*${escRightBracket}`, 'g');
}

calc(object, key, keys, function calcHandler() {
2 changes: 1 addition & 1 deletion test/spec/bindings/bindings_parser_spec.js
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ describe('Bindings parser', () => {
});

it('should bind complex attributes', () => {
const node = parse('<a href="{{x}}/{{y}}"></a>');
const node = parse('<a href="{{ x }}/{{ y }}"></a>');
const obj = {};

parseBindings(obj, node, noDebounceFlag);

0 comments on commit 7305c5f

Please sign in to comment.