Skip to content

Commit

Permalink
Hotfix for issue 78
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Quadflieg committed Mar 14, 2020
1 parent ea0eb05 commit 1968c8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function isAngularInterpolation(val: string): boolean {
val[1] === '{' &&
val[2] === '{' &&
val[val.length - 2] === '}' &&
val[val.length - 3] === '}'
val[val.length - 3] === '}' &&
!val.includes('{{', 3)
);
}
2 changes: 2 additions & 0 deletions test/interpolations/formatted.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ p {{ title }}
div
img(src="{{ itemImageUrl }}")

foo(title="{{ 'something' | translate }} - {{ 'something else' | translate }}")

// "The sum of 1 + 1 is not 4"
p The sum of 1 + 1 is not {{ 1 + 1 + getVal() }}.

Expand Down
2 changes: 2 additions & 0 deletions test/interpolations/unformatted.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ p {{title}}
div
img(src='{{itemImageUrl}}')

foo(title="{{ 'something' | translate }} - {{ 'something else' | translate }}")

// "The sum of 1 + 1 is not 4"
p The sum of 1 + 1 is not {{1 + 1 + getVal()}}.

Expand Down

0 comments on commit 1968c8c

Please sign in to comment.