Skip to content

Code blocks not fully ignored when in style tag #405

@itamar-getloam

Description

@itamar-getloam

Hi,
I'm using juice to pack an HTML file which uses Handlebars, and I found what seems to be a bug. Here's the reproduction.

To sum it up, if we process the following HTML:

<style>
    .somediv {
        color: blue;
    }

</style>

<!-- First example: Condition is outside of tag value and is ignored successfully -->
<div class="somediv" {{#if @first}} style="border-top: 1px solid #D7DFDF;" {{/if}}></div>

<!-- Second example: Condition is inside the tags value and the second part is dropped ( {{/if}} ) -->
<div class="somediv" style="{{#if @first}} border-top: 1px solid #D7DFDF; {{/if}}"></div>

You can see that the second example is missing its closing {{/if}}
I tried playing around and adding several, more specific, options to codeBlocks, but to no avail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions