prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Replace tag in svelte

Open Its-Just-Nans opened this issue 3 years ago • 0 comments

Summary

Replacing

{@html `<style>${css}</style>`}

by

{@html `<style ✂prettier:content✂="JHtjc3N9"></style>`}

when saving the file

Steps To Reproduce:

<script>
    let background = "";
    let css = "";
</script>

<div style="--test: yellow !important;">
    <p>toto</p>
    {@html `<style>${css}</style>`}
</div>

<style>
    :global(*) {
        --test: blue;
        --variable-background: var(--test) !important;
    }
</style>
  1. Create the same template
  2. Save the file (with Prettier)

Expected result

Not replacing my code

Actual result

Prettier is replacing my code

Additional information

https://user-images.githubusercontent.com/56606507/171017899-33b9f51f-b5d0-42d2-97ac-f8fe92f7e155.mp4

VS Code Version:

Version: 1.67.2
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:23:40.286Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.15.0-33-generic

Prettier Extension Version:

v9.5.0

OS and version:

Linux 5.15.0-33-generic #34-Ubuntu SMP Wed May 18 13:34:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Prettier Log Output

No log

Its-Just-Nans avatar May 30 '22 15:05 Its-Just-Nans

This is an issue or feature request for the Prettier library itself rather than the VS Code extension for prettier. Please open an issue at https://github.com/prettier/prettier.

ntotten avatar Aug 20 '22 19:08 ntotten