Whether whitespace in HTML matters depends on where it is, so the input is parsed the way a browser parses it before anything is moved. Next to a block-level element such as <div>, <p>, <li> or <table>, at the start or end of one, and between the children of elements that never render text, like <ul>, <tr>, <select> and <head>, whitespace is not rendered: the beautifier puts a line break and indentation there, and the minifier removes it. Between inline elements and text it renders as a space. In "a <b>c</b>" that space is part of the sentence, and between two links or buttons it is the gap you see, so it is never added or removed there, only collapsed to one space or, where the source already broke the line, re-indented. Elements the formatter does not know, including custom elements, count as inline, because that is how a browser displays them. The test suite checks that the rendered text of every sample is identical before and after.
Some content is never reflowed. The inside of <pre>, <textarea>, <script> and <style> is kept byte for byte, including the line break after <pre> that a browser drops, and so is any element styled white-space: pre, pre-wrap or pre-line inline or with Tailwind’s whitespace-pre classes; a class defined in your own stylesheet cannot be seen. Nothing else is rewritten when beautifying: entities, attribute quotes, the case of tag names and end tags you left out, such as </li> or </td>, stay as written, and one blank line is kept between blocks wherever the source had any. With "Wrap attributes" on, a start tag longer than 80 columns puts each attribute on its own line. Problems a browser repairs silently, such as misnested tags or an end tag that closes nothing, are listed under the output.
Minifying removes comments except the ones that do something: IE conditional comments such as <!--[if mso]>, which email templates use for Outlook, <!--! licence comments, <!--# server-side includes and Knockout’s <!-- ko --> bindings. Boolean attributes lose a value that is empty or repeats the name, so disabled="disabled" becomes disabled, but hidden="until-found" and enumerated attributes such as draggable="true" keep theirs. Quotes are removed, if you ask, only where the HTML syntax allows an unquoted value: not empty, and without spaces or any of " ' = < > `. CSS in <style> and style attributes can be minified by the same minifier as the CSS tool; JavaScript is never touched. End tags that HTML lets you omit are not removed, because doing that safely needs the full tree-construction rules. Input over 100,000 characters is processed in a background worker.