posthtml-extend icon indicating copy to clipboard operation
posthtml-extend copied to clipboard

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

Open jessehattabaugh opened this issue 1 year ago • 2 comments

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

jessehattabaugh avatar Jan 05 '24 20:01 jessehattabaugh

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.

BobVarioa avatar Feb 04 '24 17:02 BobVarioa

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

Scrum avatar Feb 09 '24 07:02 Scrum