plugin-pug
plugin-pug copied to clipboard
Bug: removes 2nd block with angular interpolation
Info
| Tool | Version |
|---|---|
| Plugin | v1.1.9 |
| Prettier | v1.19.1 |
| Node | v13.6.0 |
| OS | linux |
Input
foo(title="{{'something' | translate}} - {{'something else' | translate}}")
Output or Error
foo(title="{{ 'something' | translate }}")
Expected Output
foo(title="{{ 'something' | translate }} - {{ 'something else' | translate }}")
I think that thats coming from starts and ends with {{...}}
Have to check the middle of the string
https://github.com/prettier/plugin-pug/blob/e74dbb33ac6b2a6ac6a3c4844298653b5235f066/src/utils/angular.ts#L77
Hope I have time for this soon
At that time, I'm going to release a hotfix for this issue: https://github.com/prettier/plugin-pug/commit/1968c8cbe4919f747ad25a9d23522309d913bcaa
However, this only suppresses formatting if there is more than one binding within an attribute value. Therefore you have to format them yourself.