g-plane / markup_fmt

Configurable HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks and Vento formatter with dprint integration.
https://dprint.dev/plugins/markup_fmt/
MIT License
100 stars 9 forks source link

External code wrapper is leaked in error message #21

Closed g-plane closed 6 months ago

g-plane commented 6 months ago

If there's an error when formatting with external formatter, error message will be like:

Message: [markup_fmt] failed to format code with external formatter: `<>{content +=      &#x27;{&quot;hello&quot;: &quot;I\&#x27;m a button!&quot;}&#x27;}</>`:
Expected ',', got '+=' at file:///expr.tsx:1:12

  <>{content +=      &#x27;{&quot;hello&quot;: &quot;I\&#x27;m a button!&quot;}&#x27;}</>
             ~~
Had 1 error formatting.

The wrapper like <> and </> shouldn't be printed, otherwise it's confusing.