prettyhtml icon indicating copy to clipboard operation
prettyhtml copied to clipboard

Whitespace is being added around spans

Open thedamon opened this issue 6 years ago • 7 comments
trafficstars

🐛 Bug Report

white space is being added in between spans with no discernible way to stop it

To Reproduce

Steps to reproduce the behavior:

Paste your markup here:

      <h1>emergen<span class="t">t</span><wbr /><span
          class="dot"
          aria-hidden
        >⋅</span>seas
      </h1>

Expected behavior

the t is part of the word 'emergent', so if it needs to not have a space in front of it. The formatting should not change the resulting markup.

Current Results:

<h1>
  emergen
  <span class="t">t</span>
  <wbr />
  <span class="dot" aria-hidden>⋅</span>seas
</h1>

We are getting spaces inserted around the t, the <wbr> tag

Your Environment

https://prettyhtml.netlify.com/

thedamon avatar Aug 17 '19 17:08 thedamon

Hi @thedamon would you like to send a PR?

StarpTech avatar Aug 17 '19 20:08 StarpTech

I don't think i have the expertise or time to look at this within a reasonable timeframe. I suspect there may be some complications involved in determining exactly how to compute line wrapping without changing the whitespace

thedamon avatar Aug 18 '19 02:08 thedamon

My time is also very limited and it has currently no priority. Feel free to ask for a starting point otherwise go with prettier as formatting tool.

StarpTech avatar Aug 18 '19 10:08 StarpTech

Prettier team refuses to let us wrap attributes 1 per line so prettyhtml is my friend 😍

I could see where this would get hard to want to maintain with prettier doing much the same thing. If you know roughly where I might look I'd be curious to have a look and maaaaybe come up with something.

thedamon avatar Aug 21 '19 02:08 thedamon

@thedamon hello. Isn't that a solution to your problem?

ThD-Rizer avatar Oct 15 '19 11:10 ThD-Rizer

good workaround yes, thank you. ideally a formatter shouldn’t alter the underlying code, but that’s a good escape hatch.

thedamon avatar Oct 19 '19 01:10 thedamon

Hello, I don't know why this library is introduced into the Vue project. With this API, the project will not run. They say we can't find the third party. Can you help me? Thank you very much.

y912765390 avatar Oct 31 '19 08:10 y912765390