Documentation
¶
Overview ¶
Package htmlcompact shrinks serialized HTML syntax without touching text, comments or raw content, and proves every result by comparing parsed trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
BeforeBytes int `json:"beforeBytes"`
AfterBytes int `json:"afterBytes"`
SavedBytes int `json:"savedBytes"`
Skipped string `json:"skipped,omitempty"`
}
Result reports what compaction did. Skipped explains why the input was kept.
func Compact ¶
Compact syntax, never text. Even indentation can become visible through CSS white-space, copied text, inline layout or later script changes. The general minify/html KeepWhitespace option still collapses it and changes DOM values. Reuse the existing lexer and attribute escaper, without those transformations. Comments, raw text and closing/document tags pass verbatim. Attribute names/case and namespaces are never normalized here.