denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.03k stars 5.36k forks source link

Incorrect formatting of Svelte markup #26540

Open quadratz opened 3 days ago

quadratz commented 3 days ago
deno fmt --unstable-component MyComponent.svelte

Input:

<div
  class="{icon.name} rounded-full border {icon.borderColor} {icon.bgColor} p-3 text-3xl {icon.color}"
></div>

Output:

<div
  class={icon.name}
  rounded-full
  border
  {icon.borderColor}
  {icon.bgColor}
  {" "}
  p-3
  text-3xl
  {icon.color}
>
</div>

Version:

deno 2.0.3 (stable, release, x86_64-unknown-linux-gnu)
v8 12.9.202.13-rusty
typescript 5.6.2

Probably related to https://github.com/denoland/deno/issues/25919

bartlomieju commented 2 days ago

Traced it and reported in https://github.com/g-plane/markup_fmt/issues/69