Skip to content

Conversation

@vodik
Copy link

@vodik vodik commented Nov 11, 2025

We have a problem where we have to minify HTML that contain custom components, and these components are processed by other systems.

Introduce a new flag, preserve_self_closing_on_unknown_tags. When set, it preserves self-closing of all unknown tags, allowing them to preserve that attribute as they are processed by this minifier. Otherwise we do the standards compliant minification as normal.

I'm not particularly happy about how this reuses HTML_TAG_WHITESPACE_MINIFICATION. I'm open to suggestions on how to improve that, but it does allow us to move forward with a patch internally..

Fixes #257

@vodik vodik force-pushed the master branch 4 times, most recently from 5e5b002 to cfdec3d Compare November 11, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support to preserve self-closing syntax on non-void HTML elements

1 participant