Giter Club home page Giter Club logo

Comments (6)

Swaagie avatar Swaagie commented on July 20, 2024

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.

shellscape avatar shellscape commented on July 20, 2024

@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.

Swaagie avatar Swaagie commented on July 20, 2024

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.

shellscape avatar shellscape commented on July 20, 2024

@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.

Swaagie avatar Swaagie commented on July 20, 2024

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.

Swaagie avatar Swaagie commented on July 20, 2024

Released as 1.3.0

from minimize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.