Comments (6)
Folks, remember, if you want this feature, either use the native
I've not personally hit this issue at all, so I've no real motivation to work on it myself (that's not to say others aren't hitting the issue).
I'm generally deleting github issues with just +1
in them these days.
from inliner.
I like the approach of making the inliner do as much of the leg work for you (allowing you to opt out when it makes sense), so I think it makes sense to use the html-minifier as a module to compress the output.
My only slight concern is aggressive compression on HTML can result on a different visual representation of the markup (ie. I'd want to use the conservativeCollapse
flag for instance to ensure spaces remained intact).
I'd be open to a PR if you wanted a shot at it (please check out the contributing doc as it helps with tests and commits).
from inliner.
from inliner.
I like the approach of making the inliner do as much of the leg work for you (allowing you to opt out when it makes sense), so I think it makes sense to use the html-minifier as a module to compress the output.
Sure! Some projects at some point choose to spin-off a module (say, inliner-lib
) that only contains the minimum core logic and make the primary module depend on that and wrap it with more extra functionality. I suggest to keep this possibility in mind if you notice at some point such a need.
My only slight concern is aggressive compression on HTML can result on a different visual representation of the markup (ie. I'd want to use the conservativeCollapse flag for instance to ensure spaces remained intact).
Well, yes. The point is, your current compression on HTML already results in a different visual representation of the markup. As I mentioned in the original issue, for example, you change the visual representation of a placeholder
attribute for a textarea
, a visual representation for ~~s~~
and others.
Minifying html is pretty hard to do for a general case. In particular, any element may have a white-space: pre
specified in CSS. Thus it's important to allow disabling and possibly customize the minification process. If you keep HTML minification as part of the module, I'd suggest exposing the ability to pass options to html minifier.
I can't make any promises about PRs though, but maybe.
from inliner.
+1
from inliner.
I also have the issue when I include JS minified code: when the collapseWhitespace
option is enabled, it breaks the JS code. The html minification should really be done by a separate proven package, such as htmlmin for example.
It would also be nice if the minifier options for html/css/js could be further customized by passing through arguments directly to the minifier (I also have issues with uglifyjs default options, and there's no way to override them). This way everyone should be happy
from inliner.
Related Issues (20)
- Retrying on 503 errors HOT 3
- Feature: Option to set base url when using static file or string
- Webpack tutorial?
- Why can't I execute multiple lines of instructions in bat file?
- Not inlining <script data-main> HOT 2
- [Bug] Cannot read property 'toFixed' of undefined HOT 3
- looks like inliner ignores td background HOT 2
- Inline anchors referencing other HTML pages
- SVG elements white space getting stripped HOT 3
- active forks
- . HOT 1
- Variable name is not encoded correctly
- Combine html page, js, css in memory to an inline file HOT 1
- Unicode support HOT 1
- Doesn't inline JavaScript with type="module" HOT 2
- Not inlining scripts HOT 1
- Inliner outputs an empty web page when executed under the Node.js `exec` function
- Inline iframes HOT 2
- A ReDoS vulnerability exists in css.js
- Documentation, update example? HOT 1
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 inliner.