New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

multi_html

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi_html

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

MultiHtml Build Status Dependency Status Code Climate

There are lot of Ruby libraries to minify HTML. Instead of choosing a single implementation and forcing users of your library to be stuck with it, you can use MultiHtml instead, which will simply choose the best available HTML minifier. Here's how to use it:

require 'multi_html'

MultiHtml.min('<div>  <p>test</p>  </div>') #=> '<div><p>test</p></div>'

The use method, which sets the MultiHtml adapter, takes either a symbol or a class (to allow for custom HTML minifier) that responds to .min at the class level.

MultiHtml tries to have intelligent defaulting. That is, if you have any of the supported engines already loaded, it will utilize them before attempting to load any. It will load libraries in following order:

If no other library is available, MultiHtml falls back to html_press.

HTML::Pipeline

pipeline = HTML::Pipeline.new [
  MultiHtml::Filter
]
pipeline.call('<div>  <p>test</p>  </div>') #=> '<div><p>test</p></div>'

TODO

  • benchmark against most popular css frameworks (speed, size)
  • generate benchmark report (html or md)
  • write test suite
  • generate comparison table (html or md) with the help of test suite

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 09 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc