Skip to content

Use minify_html instead of htmlmin - #195

Merged
hrcorval merged 1 commit into
hrcorval:release_4.1.2from
danzou56:master
Mar 25, 2025
Merged

Use minify_html instead of htmlmin#195
hrcorval merged 1 commit into
hrcorval:release_4.1.2from
danzou56:master

Conversation

@danzou56

@danzou56 danzou56 commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Bug

#186

Behavex cannot be installed with python 3.13 because behavex depends on the remove cgi module via htmlmin to perform HTML minification.

Proposed solution

While the change to remove cgi from htmlmin is small, htmlmin hasn't been updated since Python 3.2/8 years ago, so it may not be reasonable to expect the maintainer to merge the pull request. Instead of relying on htmlmin, replace it with minify-html.

Behavex currently passes in pre and textarea as tags to exclude from minification. Likewise, minify-html does not remove whitespace in pre and textarea out of the box

  • Docs make a specific call out to not altering whitespace in <pre> elements
  • Tests show that whitespace is unaffected for pre and textarea elements (HTML entity 32 is a space character)

@danzou56

danzou56 commented Feb 28, 2025

Copy link
Copy Markdown
Contributor Author

While a PR supporting Python 3.13 for minify-html has been merged, a new release of the wheel has not yet been created.

@danzou56 danzou56 closed this Feb 28, 2025
@hrcorval hrcorval reopened this Mar 25, 2025
@hrcorval
hrcorval changed the base branch from release_4.1.1 to release_4.1.2 March 25, 2025 20:27
@hrcorval
hrcorval marked this pull request as ready for review March 25, 2025 20:30
@hrcorval
hrcorval merged commit ee2a19b into hrcorval:release_4.1.2 Mar 25, 2025
@hrcorval

Copy link
Copy Markdown
Owner

@danzou56 , Thanks a lot for providing the fix to support Python 3.13. We created a release candidate to be able to test the report implementation is not altered when using the new HTML minimizer: https://test.pypi.org/project/behavex/4.1.2rc1/
Best regards,

Hernan

@hrcorval

Copy link
Copy Markdown
Owner

Hi @danzou56. Please, use the following RC: https://test.pypi.org/project/behavex/4.1.2rc4/
Thanks!

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.

2 participants