sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
735 stars 95 forks source link

(feat) trim whitespace in `class` attributes #356

Closed dummdidumm closed 1 year ago

dummdidumm commented 1 year ago

fixes #339

ptrxyz commented 1 year ago

I think this does not shrink/remove whitespaces at the beginning of the string. My testing pattern was simply this:

<div class="   something    ">

Trailing whitespace is removed, yet the leading one remains the same. Am I doing it wrong?

ptrxyz commented 1 year ago

Added comments in the code in case this was not desired behavior.

dummdidumm commented 1 year ago

Could you open a new issue so we can track this? Sounds like a bug - the idea was to only keep whitespace at the start of new lines after the first line.