question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

collapseWhitespace doesn't fully collapses whitespace between two inputs

See original GitHub issue
minify("<input>    <input>", {collapseWhitespace: true});

Expected: <input><input> Actual: <input> <input>

HTMLMinifier version: 3.5.2 Node.js version: 8.1.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
alexlamslcommented, Jul 17, 2017

That’s working as expected - you may view the result in a web browser to see why that single whitespace is preserved.

0reactions
EvgenyOrekhovcommented, Apr 17, 2019

@scipper Based on alexlamsl’s comment above, I assumed that the collapseWhitespace option is not intended to alter the behavior of the code, so I googled for the rules of HTML rendering, not for the rules of html-minifier. Something like “html whitespace between elements”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do not collapse whitespace when displaying the value of the ...
Updated: I still think that it is specific to the JSF , because when I use <h:inputText value="#{MBean.test}"/> , the rendered input text...
Read more >
preserveWhitespaces:false is too aggresive and not context ...
collapse - whitespace is reduced to either a single space or a single newline depending on whether the original spaces contained a newline ......
Read more >
Fighting the Space Between Inline Block Elements | CSS-Tricks
Here's some ways to fight the gap and get inline-block elements sitting directly next to each other. Remove the spaces. The reason you...
Read more >
white-space - CSS: Cascading Style Sheets - MDN Web Docs
Collapses white space as for normal , but suppresses line breaks (text wrapping) within the source. Sequences of white space are preserved. ...
Read more >
VF Rerender auto-normalizes spaces in Text fields. Why?
I did a little experiment using this code + VF page to see if style:"white-space-collapse: preserve" had any affect.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found