mitsuhiko / jinja2-htmlcompress

Compresses HTML in Jinja2 streams
Other
128 stars 27 forks source link

Does not work correctly for macros. #4

Open bvsn opened 11 years ago

bvsn commented 11 years ago
{% macro render_menu(model, style='b-menu_type_header') %}
    <ul class="b-menu {{ style }}">

Got next html:

<ul class="b-menub-menu_type_header">

It is also does not work if I put the variable into class tag.

ostronom commented 11 years ago

A workaround: -- prepend {{ style }} with {{ " " }}.

bvsn commented 11 years ago

This is not correct.

eli-collins commented 7 years ago

I think this is similar to issue 8 -- I've got a fork of this module over in https://github.com/eli-collins/jinja2-htmlcompress with a rewritten parser that should take care of this issue - it's a little less agressive / smarter about when it completely removes spaces.