Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.

Html2Hamlpy fails if the html contains templatetags #3

Open
Psycojoker opened this issue Feb 17, 2015 · 2 comments
Open

Html2Hamlpy fails if the html contains templatetags #3

Psycojoker opened this issue Feb 17, 2015 · 2 comments

Comments

@Psycojoker
Copy link
Contributor

Hello,

As demonstrated in the following example, html2hamlpy doesn't support django templatetags syntaxe included directly into an html tag:

In [7]: print Converter('<script type="text/javascript" src="{% static \'resumable/js/django-resumable.js\' %}"></script>', 'html.parser').to_haml()
%script{src:"<dynamic dynamic=", 'resumable:"", js:"", static:"", django-resumable.js'":"", type:"text/javascript"}
">

The expected result is:

%script{src:"{% static 'resumable/js/django-resumable.js' %}", type:"text/javascript"}

Cheers,

@davidtingsu
Copy link
Owner

Thanks, I will get to this when I get the chance.

@Psycojoker
Copy link
Contributor Author

Also, to warn you from my experience of doing this manually, there is some html code that you can't convert to haml directly, for exemple:

<tag {% if condition %}foo="bar"{% endif %}>...

Is not convertible into haml AFAIK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants