pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.7k stars 1.95k forks source link

append block in mixin triggered without called #3446

Open Uriel-Alves opened 2 months ago

Uriel-Alves commented 2 months ago

Pug Version: 3.0.2 Node Version: 17.7.1

Input JavaScript Values

Using expressJS into Node

pug.renderFile('anyfile.pug');

Input Pug

mixin whatEverNameItsAllwaysDeclared()
    append head_link__script
        script.
            alert("I'm not using this mixin, but these appears at code")
    h2 BLABLABLA

h1 Hello World

block head_link__script

Expected HTML

<h1>Hello World</h1>

Actual HTML

<h1>Hello World</h1>
<script>I'm not using this mixin, but these appears at code</script>

Additional Comments

I'm not sure if its a bug, but its crazy. Just create any mixin, and dont call then. The h2 will not created was expected, but it will append blocks...