clean-html
clean-html copied to clipboard
Remove pre/post whitespace within style attributes
Currently, clean-html
transforms styles with whitespace into a clean wrapped set of lines, e.g.
<div style="
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto;
height: 100dvh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #435d7b;
background-color: #d0b641;
gap: 20px;
">...</div>
to:
<div style=" font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto; height: 100dvh; display:
flex; flex-direction: column; align-items: center; justify-content: center; color: #435d7b; background-color:
#d0b641; gap: 20px; ">
...
</div>
However, it leaves a space before the first style and after the last style. Would it be possible to strip these, i.e.:
<div style="font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto; height: 100dvh; display:
flex; flex-direction: column; align-items: center; justify-content: center; color: #435d7b; background-color:
#d0b641; gap: 20px;">
...
</div>