nette / latte

☕ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
https://latte.nette.org
Other
1.13k stars 109 forks source link

Including block foo with content type HTML into incompatible type HTML/HTML. #356

Closed Daaarkling closed 6 months ago

Daaarkling commented 8 months ago

Version: 3.0.13

Steps To Reproduce

https://fiddle.nette.org/latte/#324e7f85db

{define foo}
    <p>abc</p>
{/define}

<script type="text/html">
    {contentType html}
    <p n:class="true ? red">ahoj</p>

    {include foo}
</script>

Bug Description

With this code I'm getting Latte\RuntimeException Including block foo with content type HTML into incompatible type HTML/HTML. If I get rid of {contentType html} RuntimeException is gone but code inside <script> is not interpreted as latte. I tried to play with it but no luck. Sometimes I was even getting HTML/RAW/HTML into incompatible type HTML/HTML.

Expected Behavior

Should work. It works on 3.0.9.