Git Product home page Git Product logo

django-htmlmin's Introduction

Website do Cobrateam

django-htmlmin's People

Contributors

andrewsmedina avatar bernardobarreto avatar cabello avatar ccarigna avatar ciceroverneck avatar crazyzubr avatar dependabot[bot] avatar evildmp avatar flavianmissi avatar foobacca avatar fsouza avatar funkybob avatar hrbonz avatar jamilatta avatar jdutriaux avatar john-nguyen09 avatar mmembed avatar mystic-mirage avatar raphaelm avatar timgates42 avatar tisdall 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-htmlmin's Issues

Does this run at compile time or template run-time?

Not really an issue but it looks like this runs at template run-time. Is that correct? If so, is there a way to make this run at compile time? I imagine that some of the benefits of this project would be offset by the time it takes to compress each request.

Error: No module named BeautifulSoup

Got this error:
ImproperlyConfigured: Error importing middleware htmlmin.middleware: "No module named BeautifulSoup"

Because pip kept installing BeautifulSoup version 4.x instead of 3.2.0 despite doing:
pip install BeautifulSoup==3.2.0

Had to manually download BeautifulSoup:
http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.0.tar.gz

And run setup.py install to get it working.

I think this is not actually a django-htmlmin related issue, but thought I'd post it here in case somebody else had the same problem.

TextFields in admin don't show linebreaks if /admin/ isn't excluded from minifying

The "problem" is that if you don't exclude the admin site from minifying, and if you happen to have a TextField in your model, and you're editing an object from that model that has linebreaks in that field, the normal html output would be:

<textarea>Some text with linebreaks</textarea>

But if minified, output becomes:

<textarea>Some text with linebreaks</textarea>

One solution would be to exclude the admin site from minifying. Maybe mention this in the docs?

But what happens if you have a TextField in a custom view for your app where you edit some content? This problem will probably arise again. Can't the minifier ignore text between <textarea> tags?

Spaces removed around <a> tags in text

I have a text of the form:

    Lorem ipsum dolor sit amet....
    <a href="#">Ut enim</a> ad minim veniam

When minified the spaces around the link tags are removed, causing the linked words to cram into the surrounding text. This is with django-htmlmin 0.5.2.

I had to use non-breaking space around the links to workaround this issue.

HTML space entities are changed into regular spaces

BeautifulSoup's formatter='html' should probably be used, although it would be nice not to have all unicode characters converted to entities.
Additionally, space between a button and a another tag like a link is lost.

Example source file:

<!DOCTYPE html>
<html>
<body>
    <p>A paragraph with a&nbsp;non-breakable space</p>
    <p>And&ensp;one&thinsp;with various&emsp;spaces</p>
    <a href="#">A link</a>
    <button>A button</button>
</body>
</html>

Minified output:

<!DOCTYPE html><html><head></head><body><p>A paragraph with a non-breakable space</p><p>And one with various spaces</p><a href="#">A link</a><button>A button</button></body></html>

Pictures (input on the left, output on the right):

capture d ecran 2014-03-01 02 35 09 capture d ecran 2014-03-01 02 35 24

Each call to minify <textarea> content deletes first line if empty

Well, the title says it all, introduce some blank lines in a <textarea> and then some text content. When submitted, after minifying, the first blank line is deleted. If minified again, second blank line is deleted. So on until no blank lines are left before the text content (empty lines at the end don't get deleted).

Minifying shuffles HTML tags in my code

Hi Francisco,

When I minify my HTML code, some tags get shuffled.

For example this code:

# HTML attributes removed for clarity
html = '<header><menu><a></a><form></form></menu></header>'
html_minify(html, ignore_comments=False)

returns the following string (note the </menu> tag):

<!DOCTYPE html><header><menu><a></a></menu><form></form></header>

Is this a bug in django-htmlmin?

Decoding of html entties enables XSS attacks!

The content of textareas is html decoded, causing the possibility for xss:

In [3]: html_minify('<html><head></head><body><textarea>&lt;/textarea&gt;&lt;script type="text/javascript"&gt;alert("XSS")&lt;/script&gt;&lt;textarea&gt;</textarea></body></html>')
Out[3]: u'<html><head></head><body><textarea></textarea><script type="text/javascript">alert("XSS")</script><textarea></textarea></body></html>'

ASCII Error?

Hi guys,

I'm using your html minifcation on some HTML output for a blog. I'm getting an error that says: "'ascii' codec can't encode character u'\u22c5' in position 53: ordinal not in range(128)"

Any idea what I can do to get that fixed? From what I can see in the source code, it looks like you're trying to decode everything with utf-8, which makes me wonder why I'm getting an ASCII error.

Any ideas?

Thank you.

Issue #21 closed prematurely (inappropriate whitespace removal)

<button>First</button> <button>Second</button> has the whitespace removed, despite buttons being inline-blocks, which are whitespace-aware.

Perhaps the more appropriate solution would be to collapse multiple spaces down to one, as it'd be impossible to tell when someone's used CSS to change the display type of a div to inline.

HTML5 self-closing tags incorrectly become XHTML tags

I'm finding that, after going through the django-htmlmin middleware implicity self-closing tags (HTML5-style) are becoming explicity self-closed tags (XHTML-style).

For example the <meta> tag here…

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">

…incorrectly becomes self-closing after going through the middleware:

<!DOCTYPE html><html><head><meta charset="utf-8" />

Excessive whitespace removal

The extra whitespace in <a href="asdf">asdf</a>......<a href="asdf">asdf</a>
Should probably collapse down to <a href="asdf">asdf</a>.<a href="asdf">asdf</a>
But your code turns it into <a href="asdf">asdf</a><a href="asdf">asdf</a>

(spaces represented as periods here as the markdown is collapsing my whitespace)

Add setting for ignore URLs

It should be possible to ignore URLs in the middleware.

Something like this, on settings.py:

EXCLUDE_FROM_MINIFYING = ('^admin/',)

htmlmin causes inline javascript to be escaped

I have found inline javascript is escaped by django-htmlmin. I have constructed a simple test case. I start with a file testmin.html with contents:

<DOCTYPE html>
<html>
<body>
<h1>Test page</h1>
<script type="text/javascript">
//<!--
if (4 > 3 && 3 < 4) {
        console.log("js working");
}
//-->
</script>
</body>
</html>

Then I run pyminify testmin.html and get the output:

<html><head></head><body><doctype html=""><h1>Test page</h1><script type="text/javascript">
//&lt;!--
if (4 &gt; 3 &amp;&amp; 3 &lt; 4) {
        console.log("js working");
}
//--&gt;
</script></doctype></body></html>

The if statement isn't going to work very well ...

Can't drop nested comments

Nowadays, django-htmlmin is not able to drop nested comments:

<html>
    <body>
    <!-- outside comment <!-- inside comment --> oh yeah -->
    </body>
</html>

How to cache minified pages?

Hi, I'd love to use HtmlMinifyMiddleware, but I can't figure out where to put it in my settings.MIDDLEWARE so that it does its job, but is then also cached, so that we don't have to minify again until the page changes or the cache expires. As it is now, when I disable HtmlMinifyMiddleware, my server can handle >60X more requests per second, which suggests that, when it is enabled, HtmlMinifyMiddleware is doing its job for each request. I'd like it to do its job only when the page is rewritten to memcache via UpdateCacheMiddleware/FetchFromCacheMiddleware.

My settings look a bit like this:

MIDDLEWARE = (
    'django.middleware.cache.UpdateCacheMiddleware',
    'htmlmin.middleware.HtmlMinifyMiddleware',
    ...  # Other middleware
    'django.middleware.cache.FetchFromCacheMiddleware',
    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
)

My reasoning (which could easily be misguided), is that minification should be the last thing to happen to a response body before it gets stored in the cache, hence, it should be the last thing before UpdateCacheMiddleware on the way "out" as a response, therefore the first thing after UpdateCacheMiddleware in the MIDDLEWARE tuple.

I'm using Python 2.7 and Django 1.4, if that is relavant.

What am I doing wrong? Also, whatever the answer, it would make a good addition to the installation guide.

Breaks Django Auth Tests--traceback below, django 1.5

FAIL: test_password_change_fails_with_mismatched_passwords (django.contrib.auth.tests.views.ChangePasswordTest)

Traceback (most recent call last):
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 275, in test_password_change_fails_with_mismatched_passwords
self.assertContainsEscaped(response, SetPasswordForm.error_messages['password_mismatch'])
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 53, in assertContainsEscaped
return self.assertContains(response, escape(force_text(text)), **kwargs)
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/test/testcases.py", line 659, in assertContains
msg_prefix + "Couldn't find '%s' in response" % text)
AssertionError: Couldn't find 'The two password fields didn't match.' in response

FAIL: test_confirm_different_passwords (django.contrib.auth.tests.views.PasswordResetTest)

Traceback (most recent call last):
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 218, in test_confirm_different_passwords
self.assertContainsEscaped(response, SetPasswordForm.error_messages['password_mismatch'])
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 53, in assertContainsEscaped
return self.assertContains(response, escape(force_text(text)), **kwargs)
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/test/testcases.py", line 659, in assertContains
msg_prefix + "Couldn't find '%s' in response" % text)
AssertionError: Couldn't find 'The two password fields didn't match.' in response

FAIL: test_email_not_found (django.contrib.auth.tests.views.PasswordResetTest)

Error is raised if the provided email address isn't currently registered

Traceback (most recent call last):
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 90, in test_email_not_found
self.assertContainsEscaped(response, PasswordResetForm.error_messages['unknown'])
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/contrib/auth/tests/views.py", line 53, in assertContainsEscaped
return self.assertContains(response, escape(force_text(text)), **kwargs)
File "/Users/dakinsloss/Sites/DjangoProjects/swrev/env/lib/python2.7/site-packages/django/test/testcases.py", line 659, in assertContains
msg_prefix + "Couldn't find '%s' in response" % text)
AssertionError: Couldn't find 'That email address doesn't have an associated user account. Are you sure you've registered?' in response

Ascii error

Error while run pyminify
Versão testada: django_htmlmin-0.7.0-py2.7.egg-info

pyminify index.html > index_minified.html
Traceback (most recent call last):
File "/home/cassiobotaro/.virtualenvs/teste/bin/pyminify", line 9, in
load_entry_point('django-htmlmin==0.7.0', 'console_scripts', 'pyminify')()
File "/home/cassiobotaro/.virtualenvs/teste/lib/python2.7/site-packages/htmlmin/commands.py", line 24, in main
print html_minify(content, ignore_comments=not args.keep_comments)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 205: ordinal not in range(128)

HTML:

{% extends "base.html" %} 
{% block conteudo %}
<section>
  <div  class="container">
    <div class="jumbotron">
      <h1> <i class="fa fa-bar-chart-o"></i>teste V2 <small class="text-muted">Torça com emoção.  </small></h1>
      <p>{{lipsum(2)}}</p>
      <button class="btn btn-success">Cadastrar!</button>
    </div>
  </div>
</section>
{% endblock %}

Non-breaking space breaks pyminify

Given this HTML file:

<html>
<head>
    <title>Test&nbsp;This</title>
</head>
<body>
    <h1>Test</h1>
    <p>Code:</p>
    <pre>
 a
   b
     c
    </pre>
    </body>
</html>

Then:

$ pyminify test.html
<html><head><title>Test This</title></head><body><h1>Test</h1><p>Code:</p><pre> a b c</pre></body></html>

Which is incorrect, as it doesn't format the pre tag correctly. When outputing to a file, the error is different:

$ pyminify test.html > output.html
Traceback (most recent call last):
  File "/usr/local/bin/pyminify", line 9, in <module>
    load_entry_point('django-htmlmin==0.6.2', 'console_scripts', 'pyminify')()
  File "/usr/local/lib/python2.7/dist-packages/htmlmin/commands.py", line 24, in main
    print html_minify(content, ignore_comments=not args.keep_comments)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 23: ordinal not in range(128)

Provide option to ignore comments

Using lxml, it's impossible to not ignore comments.

We need to provide a way to not ignore comments. We would need to stop using lxml :)

don't minify when DEBUG=True

I think the Title says it all. I think it is desirable to keep the code in original format during the development. Maybe introduce a new settings, HTML_MINIFY=not DEBUG or something like that...

Incorrect html escaping script tags

I have a javascript intensive web app, and rely on <script> tags to hold html template information. So it's common in my templates have something like:

<script type="text/mustache" data-template-name="special">
    <div class="item" data-id="{{ slug }}/">
        <img src="{{ image }}" alt="{{ title }}" class="cover" />
        <p>
            {{ header }}
            <strong>{{ title }}</strong>
        </p>
    </div>
</script>

On production environment with htmlmin setup the html fragment above is converted to the following snipset, that cause an dom error on my app.

<script data-template-name="special" type="text/mustache">
    &lt;div class="item" data-id="{{ slug }}/"&gt;
        &lt;img src="{{ image }}" alt="{{ title }}" class="cover" /&gt;
        &lt;p&gt;
            {{ header }}
            &lt;strong&gt;{{ title }}&lt;/strong&gt;
        &lt;/p&gt;
    &lt;/div&gt;
</script>

This is a common pattern for javascript apps, and an obvious misbehaviour of the middleware.

Thanks,

Minify inline JavaScript

It'd be nice to minify inline JavaScript.

The minify function could receive a boolean parameter (just like ignore_comments):

minify(html_code, compress_js =True)
minify(html_code, compress_js=False)

UnicodeDecodeError

I think I've found another bug. I have a TextField in a model, and in the admin site, when I input a latin character, for example: á, after I submit the change_form and try to edit that object I get this error.

Here's the traceback:

Django Version: 1.3
Python Version: 2.6.1

Traceback:
File "/Users/jonito/mingus/proyectos/galerias-belgrano/bootstrap/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1.             response = middleware_method(request, response)
    
    File "/Users/jonito/mingus/proyectos/galerias-belgrano/bootstrap/src/django-htmlmin/htmlmin/middleware.py" in process_response
  2.         response.content = html_minify(response.content)
    
    File "/Users/jonito/mingus/proyectos/galerias-belgrano/bootstrap/src/django-htmlmin/htmlmin/minify.py" in html_minify
  3.         html_code = html_code.replace(script, TAGS_PATTERN % (tag, index))
    

Exception Type: UnicodeDecodeError at /admin/chunks/chunk/2/
Exception Value: ('ascii', '<textarea id="id_content" rows="10" cols="40" name="content" class="vLargeTextField">Lunes a S\xc3\xa1bados de 9 a 20hs.</textarea>', 94, 95, 'ordinal not in range(128)')

whitespace before <a ..> being squashed

In the below snippet you can see there is leading whitespace before the <a ...> tag. But in the minified version, there is no space, it becomes perserve<a .. which means when rendered there is no space.

$ cat ~/tmp/testmin2.html

<DOCTYPE html>
<html>
<body>
<h1>Test page</h1>
<p>
Do we preserve
        <a href="#">space</a>?
</p>
</script>
</body>
</html>

$ bin/pyminify ~/tmp/testmin2.html

<html><head></head><body><doctype html=""><h1>Test page</h1><p>Do we preserve<a href="#">space</a>?</p></doctype></body></html>

Minifier minify pre and script tags

At some places I have found that minifier minify inline script tags and also pre tags. This is problem if we have single line -comments in script tags. This does not happen for every script tag but for 1 out of 8 it is happening, can't understand what is the problem.
You can check for pre tags with following code, it is minifying it
http://djangosnippets.org/snippets/727/

Provide a view decorator

Provide a view decorator, for something like this:

@minify
def home(request)
    return render_to_response('home.html')

Breaks CSS and JS containing < and > signs.

Hey -- awesome project!

I'm using this to minify some HTML, which happens to use the CSS '>' selector, aka child combinator, (see, e.g. http://stackoverflow.com/questions/3225891/what-does-mean-in-css-rules)

I have a stylesheet containing:

<style type="text/css">
   .container > hr {
       height: 5px;
   }
</style>

which after running html_minify() in Flask becomes invalid:

<style type="text/css">
   .container &gt; hr {
       height: 5px;
   }
</style>

Similarly, I have some inline <script> tags with brackets, used to fall back from CDN failures that also have their < > signs replaced:

<script>$('body').popover || document.write('<script src="/s/js/bootstrap-2.2.2.min.js">\x3C/script>');</script>

becomes

<script>$('body').popover || document.write('&lt;script src="/s/js/bootstrap-2.2.2.min.js"&gt;\x3C/script&gt;');</script>

&lt; and &gt; get converted to < and > respectively

I have this snippet of an html page::

<div class="highlight"><pre><span class="cp">&lt;!DOCTYPE html&gt;</span>
<span class="nt">&lt;html</span> <span class="na">lang=</span><span class="s">&quot;en&quot;</span> <span class="na">dir=</span><span class="s">&quot;ltr&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;head&gt;</span>
        <span class="nt">&lt;title&gt;</span>My Site!<span class="nt">&lt;/title&gt;</span>
    <span class="nt">&lt;/head&gt;</span>
    <span class="nt">&lt;body&gt;</span>
        <span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;pagebody&quot;</span><span class="nt">&gt;</span>
            %include
        <span class="nt">&lt;/div&gt;</span>
    <span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span>
</pre></div>

When I try to run this through html_minify() I will wind up with the < and > pieces of text being treated as html tags. I think the problem with that is rather obvious, but if I didn't make sense, let me know and I'll try to explain better.

TypeError: object of type 'NoneType' has no len()

I am trying to minify .html file with:

html = "<html>...</html>"
from htmlmin.minify import html_minify
html = html_minify(html)

If I put any hebrew letter inside the html I get:

Traceback (most recent call last):
  File "<stdin>", line 22, in <module>
  File "/root/.virtualenvs/me_etcs/lib/python2.6/site-packages/htmlmin/minify.py", line 38, in html_minify
    soup = bs4.BeautifulSoup(html_code, parser)
  File "/root/.virtualenvs/me_etcs/lib/python2.6/site-packages/bs4/__init__.py", line 162, in __init__
    elif len(markup) <= 256:
TypeError: object of type 'NoneType' has no len()

What can be done please to allow hebrew chars inside template?

ignore option

hey, thanks for the module. i just tried your app, and it looks awesome as it is already.

i'm using grappelly admin interface and it looks kinda wierd with your middleware. the selectors loose their default height and become oneliners. it's very uneasy when you have the list with lots of elements.

so i would kindly feature request for some decorator or optional ignore settings. in my case i would like to ignore the whole admin interface.

anyway, thanks for your job.

support Python 3

I didn't even test it on Python 3, I really don't know which problems we will face :-)

Specify a copyright license

This is a critical bug. You must specify the copyright license under which you distribute this program to others. I cannot use your code until this is fixed.

Questions

Hi,

  1. Is django-htmlmin different from asset managers such django-compressor?

  2. If I use gzip compression in my webserver, would django-htmlmin still be necessary?

Thanks.

BeautifulSoup mess the HTML code

Here is the sample:

>>> from htmlmin.minify import html_minify
>>> html = ''' <div class="inner">
...                             
...                                 <header><h1>Escalabilidade</h1></header>
...                             
...                             
...                                 <section><p><strong>Aplicações</strong> que escalam atendem a alguns requisitos básicos:</p>
... <ol class="build arabic simple">
... <li>são capazes de lidar com o crescimento de usuários</li>
... <li>são capazes de lidar com o crescimento de dados</li>
... <li>permanecem simples e fácil de manter à medida que evoluem (!)</li>
... </ol>
... 
... 
... </section>
...                             
...                         </div>'''

Here is what happens:

>>> html_minify(html)
'<!DOCTYPE html><div class="inner"><header><h1>Escalabilidade</h1></header><section></section><p><strong>Aplica\xc3\xa7\xc3\xb5es</strong> que escalam atendem a alguns requisitos b\xc3\xa1sicos:</p><ol class="build arabic simple"><li>s\xc3\xa3o capazes de lidar com o crescimento de usu\xc3\xa1rios</li><li>s\xc3\xa3o capazes de lidar com o crescimento de dados</li><li>permanecem simples e f\xc3\xa1cil de manter \xc3\xa0 medida que evoluem (!)</li></ol></div>'

Seems to be a problem with BeautifulSoup:

>>> from BeautifulSoup import BeautifulSoup
>>> b = BeautifulSoup(html)
>>> b
 <div class="inner">
<header><h1>Escalabilidade</h1></header>
<section></section><p><strong>Aplicações</strong> que escalam atendem a alguns requisitos básicos:</p>
<ol class="build arabic simple">
<li>são capazes de lidar com o crescimento de usuários</li>
<li>são capazes de lidar com o crescimento de dados</li>
<li>permanecem simples e fácil de manter à medida que evoluem (!)</li>
</ol>

</div>
>>>

IndexError: list index out of range

hi guys,
thanks for sharing this app, i really like it. just one strange thing, one some pages i'll get a django error message, even if i am still able to open the page:

File "/home/user/webapps/wiki/lib/python2.6/django/core/handlers/base.py", line 178, in get_response
response = middleware_method(request, response)

File "/home/user/lib/python2.6/htmlmin/middleware.py", line 25, in process_response
response.content = html_minify(response.content, ignore_comments=not keep_comments)

File "/home/user/lib/python2.6/htmlmin/minify.py", line 36, in html_minify
if not between_two_tags(minified_line, minified_lines, index):

File "/home/user/lib/python2.6/htmlmin/util.py", line 11, in between_two_tags
if current_line and not current_line.startswith('<') and not all_lines[index-1].endswith('>'):

IndexError: list index out of range

any idea? or is it my html? i double checked everything.
thanks,
horndash

ps. there are two typos in the documentation:

it says: from htmlmin.decorator import no_minified_response
but it should say from htmlmin.decoratorS import noT_minified_response

Facing bug while executing html_minify(html, ignore_comments=False)

Hi,
I am facing the given problem while executing the given function

minified_html = html_minify(html, ignore_comments=False)
Traceback (most recent call last):
File "", line 1, in
File "/home/paritosh/refactor/refactor/external_apps/htmlmin/minify.py", line 17, in html_minify
soup = HtmlMinifyParser(html_code)
File "/home/paritosh/refactor/refactor/external_apps/htmlmin/parser.py", line 12, in init
super(HtmlMinifyParser, self).init(_args, *_kwargs)
TypeError: super() argument 1 must be type, not classobj

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.