-
Notifications
You must be signed in to change notification settings - Fork 996
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
minify_html = true causes Major page formatting issues to pages with numbered code blocks. #1942
Comments
The non minified HTML output looks sane, it might be a bug in https://github.com/wilsonzlin/minify-html that should be reported there |
Thanks, will open an issue report now. |
It turns out the generated html was attempting to attempting to close nonexistent spans |
Hm weird I didn't notice those invalid span 🤔 |
So it turns out this is going to be a fair bit more complicated than I had hoped.
|
Can someone submit a failing test so we have that at least? |
I already did in the opening post....
I can try and reduce the size of the test to something more basic though.... (let me know what your looking for) |
Woops sorry I missed the link to the repo in the initial post when I commented. |
hey, was poking around the codebase. Where is the code which is causing the bug, or the likely source of the bug. Also what's the components dir separate from src? |
I'de say find the section that deals with numbered code blocks, but I do not know where that is, it sounds like @jhpratt might have investigated it at one point, before it ended up looking like a difficult fix, so maybe they know. |
I don't recall offhand what file or chunk of code it was that was relevant. My previous comment effectively sums up my recollection. It's not an easy task, unfortunately. |
It will somewhere in https://github.com/getzola/zola/tree/master/components/markdown/src/codeblock
This is a Cargo workspace, Zola is split in a few sub crates to speed up compilation. |
The issue to me seems to be that syntect's HTML ouptut is very inflexible. The most flexible way (and the method we're currently using) is with It is possible to copy the implementation of Incidentally, this does not seem to be an issue for the |
Bug Report
minify_html = true
causes Major page formatting issues to pages with numbered code blocks.This was first reported to the abridge theme: Jieiku/abridge#84
I implemented this in the after-dark theme and seen the same effect (pay particular attention to the footer at the bottom of the pages)
with
minify_html = false
it looks normal:Environment
Zola version: 0.16.0
I also tested 0.15.3 with the same result.
Expected Behavior
The page should look the same with or without
minify_html = true
Current Behavior
No Errors, just errors in page formatting when using
minify_html = true
Step to reproduce
git clone https://github.com/Jieiku/zola-minify-test cd zola-minify-test zola serve
open this page: http://127.0.0.1:1111/overview-code-blocks/
Notice the page section headings and page footer are all broken following the numbered code blocks.
To further confirm the issue you can removed the line numbered code blocks, then
minify_html = true
will no longer cause an issue.The text was updated successfully, but these errors were encountered: