-
Notifications
You must be signed in to change notification settings - Fork 18
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
Ignore certain blocks from minification? #50
Comments
You could use the defaults blocks of |
@Swaagie I know you've mentioned in the README.md that PHP inline templates are not supported but adding functionality that would allow for certain start/end blocks to be ignored would solve that as well. I was thinking about trying to implement this actually and perhaps it would require up to 2 passes where you don't actually ignore certain blocks but replace them with placeholders {{$1}} as necessary prior to the current HTML minification logic and restoring the map subsequently afterwards. Would this be possible? I'm desperately trying to achieve minification of PHTML for the HTML only portion (while ignoring PHP) --- Would this be possible or easy to integrate? |
Sorry for the slow response, the only proper way to implement this would be by providing a custom DOM parser. Currently the domparser of htmlparser2 is used by default. This parser confuses the edit: as for replacing, that could be done probably as |
I have a large block of static markdown text that later gets parsed by my javascript.
ie,
When I minify this, all the spacing gets removed and so the resulting markdown looks all squished when rendered.
Specifying
empty: true, loose: true, spare: true
does not help.Is there a way I can keep my markdown text in HTML, but tell
minimize
to ignore this block?The text was updated successfully, but these errors were encountered: