Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
82 stars 2 forks source link

[Prettier plugin] Escaped quote inside alpine js attribute #81

Closed Roardom closed 10 months ago

Roardom commented 10 months ago

A file containing

<button x-on:click="console.log('I\'m an escaped quote')">Text</button>

becomes

<button x-on:click="console.log("I'm an escaped quote")">Text</button>

prettier-plugin-blade: 1.6.14 prettier: 2.8.8

JohnathonKoster commented 10 months ago

Interesting - can replicate this behavior with just prettier (it uses prettier's babel parser to format inside things like x-on). I'll add a short-circuit to prevent it from trashing stuff like that though 👍

JohnathonKoster commented 10 months ago

Improved in v1.6.15, with additional test coverage