Giter Site home page Giter Site logo

html_press's People

Contributors

stereobooster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

html_press's Issues

Adds whitespaces in attributes

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.

Preserving whitespace

I've had some unexpected behaviour minifying an unordered list. Let's say you have the following HTML:

`

  • Item 1
  • Item 2
`

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.

Javascript regex \+ being removed

I had some inline javascript .match(/[\+|\-]/)) which would be compressed to .match(/[|\-]/)), which would mess up some of my logic.

Parsing issue

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>

incorrect handling of <script src="...">, spaces removed

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

Stripping out input type attributes on form

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

Error installing gem

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

Invalid option: inline_script

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

malformed node attributes

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"/>

Preserve HTML Comments

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?

The script removes the break/empty line from textarea

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

state of the gem: depreacted

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.

Incorrect rem formatting

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!

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.