emscripten-core / emscripten-core/emscripten

HTML minification modifies content re: whitespace

Open
#16,656 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

image

This only happens for release (debug does not minify HTML).

Related code: https://github.com/emscripten-core/emscripten/blob/011fabea9dc77a100fb26044e1e5df8a52559fee/emcc.py#L3661

Can be avoided with `-s MINIFY_HTML=0`

Personally I don't think emscripten should bother minifying HTML at all. For my shell file, minification reduced the file from 10KB to 6.5KB, so the savings just aren't worth it. And given the complexity of the minify_html function (a lot of flags passed to this external tool, many knobs to turn) there may be other unwanted semantic modifications going on here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.