Comments (6)
Afraid the module doesn't do any CSS parsing and won't either in the future, so checking by style is not feasible, that said do you have a small example that shows how this would look. Perhaps another pattern can be found that can be used for detection.
from minimize.
@Swaagie what about data-
attributes, or a custom minimize-
attribute such as minimize-pre
or some such that would act as a line-flag/option (similar to how jshint allowed per-line options). Those 'vendor' attributes could be removed in the resulting html. That'd allow some additional instruction to minimize, and be unobtrusive to the output.
<td minimize-pre> whitespace intact </td>
resulting in
<td> whitespace intact </td>
from minimize.
This might be a nice feature for a plugin, will check if it is possible to add plugins that are run before
and after
minimizing. This will not be a core feature however, as it is outside the scope of html. Also not that there are 3 elements which retain their structural whitespace. See https://github.com/Moveo/minimize/blob/master/lib/list.js#L36-L39, wouldn't that cover the functionality you require?
from minimize.
@Swaagie please do let me know what you find.
Regarding elements which retain their whitespace, please see the original post. When dealing with email, specifically generating html emails (for many marketing and internal purposes) the focus needs to be on the size of the resulting html. Anything over 120kb and Gmail clips the message. When you're dealing with html and rudimentary html structure, it's really easy to get up to that limit. We're squeezing every KB out that we can.
It also just occurs to me that I might be able to strip out those tags after the minification, which might be another useful application for a plugin.
from minimize.
Started work on the plugin architecture in the #plugin branch. Async reducing is going to be a bit tricky, basically if I'm done you should be able to hook into each element that gets crawled by the reducer.
from minimize.
Released as 1.3.0
from minimize.
Related Issues (20)
- An in-range update of cli-color is breaking the build 🚨 HOT 1
- An in-range update of uuid is breaking the build 🚨 HOT 1
- HTML Attribute Contenteditable Removed By Minimize
- HTML minification eats up spaces between inline elements HOT 3
- Maximum call stack size exceeded HOT 1
- Empty attributes are assigned blank values HOT 4
- This is beyond the scope of this project. NO, IT'S NOT HOT 3
- Django templates error HOT 8
- html tags are autoclosed within a single html file HOT 2
- Keep case HOT 1
- Empty space in attribute HOT 1
- Stripping off extra HTML tags HOT 4
- Minify inline JS - Package link broken? HOT 7
- minifying all HTML files recursively in folder HOT 1
- SSI only supports #includes
- Attribut draggable is no redundant attribute HOT 1
- Feat: remove development code
- Track elements are not considered void elements
- Version 10 of node.js has been released
- An in-range update of htmlparser2 is breaking the build 🚨 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minimize.