stereobooster / html_press Goto Github PK
View Code? Open in Web Editor NEW๐จ [deprecated] Ruby gem for compressing html
License: MIT License
๐จ [deprecated] Ruby gem for compressing html
License: MIT License
Must be
data-l10n="open-source-text"
But for some reasons it turns into
data-l10 n="open-source-text"
Thats works not for all attributes, some of them fine.
I am trying to minify that project.
I've had some unexpected behaviour minifying an unordered list. Let's say you have the following HTML:
`
This will display as:
Item 1 Item2
After being minimized using html_press it changes to:
Item1Item2
I'm trying to find the balance between rendering the original HTML file vs squeezing out minimal HTML. In my case I've forked html_press and commented out process_block_elements.
From the library's point of view it's not clear if you can make the same decision because whitespace should have no effect block level elements unless you mess with them in CSS.
It's something for you to ponder anyway.
I had some inline javascript .match(/[\+|\-]/))
which would be compressed to .match(/[|\-]/))
, which would mess up some of my logic.
The following does not get minified properly.
<li data-location="<b>Location</b>"></li>
An extra space is getting inserted into the first bold tag...
<li data-location='< b>Location</b>'></li>
Hi,
I created a Rack middleware (https://github.com/wbotelhos/html_compress) to automatically compress the html page in a Rails application. I still need to write some tests, but I'm using it and working well.
Maybe it can enter on your Rails usage section. (:
It is working here: http://estacione.com
I have the folowing in a layout:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script>
With html_press, it renders without a space:
<scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
UPDATE: If I place a placeholder like an underscore like this <script ...>_</script>
then it works...
html_press is removing input type attributes for text fields in a form. This is causing styling on a single page on my site to break. I know there may be alternative ways to fix this, but IMHO this is too aggressive. #18
Trying to install the html_press gem, I get this error:
โ OliverJAsh sudo gem install "html_press"
ERROR: While executing gem ... (NoMethodError)
undefined method `call' for nil:NilClass
If in my view there is a <script>
tag, it brokes html_press.
ArgumentError at / Invalid option: inline_script file: uglifier.rb location: initialize line: 86
If you run this following HTML through html_press, you will see that the output gets mangled somehow. I know that this is not 100% valid html. I wanted to get you the smallest code that triggered the bug.
This html...
<embed allowFullScreen="true" allowScriptAccess="always"/>
produces this...
<embed allowFullScreen="FS="true" allowScriptAccess="SA="always"/>
It would be great to define exceptions like the minifier should not strip specific attributes like input type="text"
when specified.
Would that be possible?
Also described in: octopress/minify-html#9 (comment)
Have you had any requests for this feature? i.e. where you want to add comments to the bottom of a page viewable when viewing code source?
I encode emails using sites like http://www.davidegrayson.com/emailhider/ to hide my email from harvesters that do not decode emails.
This plugin decodes email for the final result, can this be disabled?
When we break lines into textarea we want it comes back on edition, but it is cleaned, putting all code together.
The right:
------------------------------------------
I jumped one
Line
------------------------------------------
The wrong and actual:
------------------------------------------
I jumped one
Line
------------------------------------------
The initial purpose of this gem was to be able to minify HTML in Ruby without JS execution environment, to use it together with jekyll_press. I deprecated jekyll_press, so not sure if this needed anymore. I do not have time to support it and marked it as deprecated.
Take this bit of example code:
<div style="padding:2rem;"></div>
html_press transforms this into:
<div style="padding:2 rem"></div>
This breaks the website rendering of this padding element, as a space is put in between the "2" and the "rem". This means I can't use rem units inline with my HTML.
I use Octopress minify HTML plugin, which uses this gem. Apologies if this doesn't directly affect html_press, I just thought this to most likely be an upstream issue!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.