Skip to content

Commit cc09a6f

Browse files
authored
Remove the use of --collapse-inline-tag-whitespace pass (#22346)
Remove the use of --collapse-inline-tag-whitespace pass, which results in too eager whitespace minification on minified HTML pages. Fixes #22188. See also terser/html-minifier-terser#179.
1 parent 10feff5 commit cc09a6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/link.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2597,7 +2597,6 @@ def minify_html(filename):
25972597
# -g1 and greater retain whitespace and comments in source
25982598
if settings.DEBUG_LEVEL == 0:
25992599
opts += ['--collapse-whitespace',
2600-
'--collapse-inline-tag-whitespace',
26012600
'--remove-comments',
26022601
'--remove-tag-whitespace',
26032602
'--sort-attributes',
@@ -2615,6 +2614,10 @@ def minify_html(filename):
26152614
'--minify-js', 'true']
26162615

26172616
# html-minifier also has the following options, but they look unsafe for use:
2617+
# '--collapse-inline-tag-whitespace': removes whitespace between inline tags in visible text,
2618+
# causing words to be joined together. See
2619+
# https://github.com/terser/html-minifier-terser/issues/179
2620+
# https://github.com/emscripten-core/emscripten/issues/22188
26182621
# '--remove-optional-tags': removes e.g. <head></head> and <body></body> tags from the page.
26192622
# (Breaks at least browser.test_sdl2glshader)
26202623
# '--remove-empty-attributes': removes all attributes with whitespace-only values.

0 commit comments

Comments
 (0)