-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML minification sometimes adds duplicate characters to output #1292
Comments
Hmm our code does basically
where with_friendly_error is from the minify_html crate. I don't think we do any processing other than that so this is weird. |
Ah I see what's happening, we shouldn't use that method probably I guess, or at least we should split based on the length we get back. |
Fixed on the |
Glad to help, and thanks for fixing this so quickly |
Bug report
When
minify_html = true
in the site config, Zola will minify HTML pages but will sometimes include unwanted duplicate characters in the HTML output. Extra junk is appended to the complete HTML page, with the junk being a copy of some of the characters at the end of the HTML document. This seems to be a problem with Zola, not the underlying minify-html crate.Environment
Zola version 0.13.0, compiled from commit aa03a7fe.
Expected behaviour
When
minify_html = true
in the config, I would expect Zola's output to match the output of minify-html, but it doesn't.Current behaviour
On some pages (possibly only the site homepage index.html template) extra junk is appended to the complete HTML page. The junk is a copy of some of the characters at the end of the HTML document.
Steps to reproduce
I've created a minimal example in the flother/zola-html-minification-test repo. There's one section, "Blog", with a single post, and there's an
index.html
template to render the site homepage.If you clone that repo, set
minify_html = false
inconfig.toml
, and use the site as input forzola build
, Zola v0.13.0 will usetemplates/index.html
to createpublic/index.html
, which will look like this:If you run the unminified version of
public/index.html
through minify-html (minify-html --src public/index.html
) you get:If you then change the minify_html setting in
config.toml
to beminify_html = true
and runzola build
, Zola will createpublic/index.html
to look like this:Everything after the first
FOO BAR
are duplicate characters from the page and shouldn't be included in the output.The text was updated successfully, but these errors were encountered: