posthtml / posthtml-extend

Template extending (Jade-like)
MIT License
47 stars 9 forks source link

<blocks> in <title> of template cannot be found #60

Open jessehattabaugh opened 8 months ago

jessehattabaugh commented 8 months ago

When I attempt to use the example base.html and index.html from the README with parcel, the <block> in the <title> of base.html cannot be found.

image

If I add "strict": false to the config the <block name="content"> gets replaced, but not the <block name="title">

image

Reproducing repo here: https://github.com/jessehattabaugh/posthtml-extend-bug

BobVarioa commented 7 months ago

Adding onto this issue, the cause seems to be because title element's content is always recognized as a string in htmlparser2 so therefore it will never find the block tag as it doesn't exist. The example should be removed from the docs, as this seems to be intentional functionality.

Scrum commented 7 months ago

related https://github.com/fb55/htmlparser2/issues/642