jinja2-htmlcompress icon indicating copy to clipboard operation
jinja2-htmlcompress copied to clipboard

Does not work correctly for macros.

Open bvsn opened this issue 12 years ago • 3 comments

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

bvsn avatar Nov 17 '12 17:11 bvsn

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

ostronom avatar Nov 18 '12 10:11 ostronom

This is not correct.

bvsn avatar Nov 20 '12 09:11 bvsn

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.

eli-collins avatar May 22 '17 19:05 eli-collins