Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

BUG: Incorrect HTML auto-formatting #82

Closed
scottjmaddox opened this issue Oct 10, 2019 · 3 comments
Closed

BUG: Incorrect HTML auto-formatting #82

scottjmaddox opened this issue Oct 10, 2019 · 3 comments

Comments

@scottjmaddox
Copy link

<h2>(Early Access<span style="font-size:0.9em">s</span><span style="font-size:0.8em">s</span><span
              style="font-size:0.7em">s</span><span style="font-size:0.6em">s</span><span
              style="font-size:0.5em">s</span><span style="font-size:0.4em">s</span>)</h2>

gets reformatted to


      <h2>
        (Early Access
        <span style="font-size:0.9em">s</span>
        <span style="font-size:0.8em">s</span>
        <span style="font-size:0.7em">s</span>
        <span style="font-size:0.6em">s</span>
        <span style="font-size:0.5em">s</span>
        <span style="font-size:0.4em">s</span>
        )
      </h2>

which is semantically different because it includes spaces between the spans.

On a related note, is there a way to selectively skip reformatting of some HTML as a workaround? I tried <!-- prettier-ignore -->, but it doesn't seem to work.

@mdorda
Copy link

mdorda commented Oct 18, 2019

I am facing the same issue:

... abc text <a href="#">link</a>. Another text ...

has an output: ... abc text link. Another text ...

But after auto formatting into:

... abc text
<a href="#">link</a>
. Another text ...

is the output: ... abc text link . Another text ... (with a space between link and dot)

@jasonlyu123
Copy link

related issue on prettier-plugin-svelte
sveltejs/prettier-plugin-svelte#41
sveltejs/prettier-plugin-svelte#59

@schneyra
Copy link

I'm having the same problem and could not yet find a working workaround. Any ideas?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@schneyra @jamesbirtles @mdorda @scottjmaddox @jasonlyu123 and others