Skip to content

Block in title results in unexpected block #53

@MattIPv4

Description

@MattIPv4

With posthtml@0.13.4 & posthtml-extend@0.5.0, the following works just fine:

<html>
    <head>
        <title><block name="title"></block> — Github</title>
    </head>

    <body>
        <div class="content">
           <block name="content"></block>
        </div>
    </body>
</html>
<extends src="base.html">
    <block name="title">How to use posthtml-extend</block>
    <block name="content">Read the documentation</block>
</extends>

With posthtml@0.13.4 & posthtml-extend@0.5.1, it errors:

[posthtml-extend] Unexpected block "title"
    at getError (node_modules/posthtml-extend/lib/extend.js:228:12)
    at mergeExtendsAndLayout (node_modules/posthtml-extend/lib/extend.js:156:23)
    at node_modules/posthtml-extend/lib/extend.js:91:31
    at node_modules/posthtml/lib/api.js:91:45
    at traverse (node_modules/posthtml/lib/api.js:105:26)
    at Array.match (node_modules/posthtml/lib/api.js:90:7)
    at handleExtendsNodes (node_modules/posthtml-extend/lib/extend.js:81:16)
    at node_modules/posthtml-extend/lib/extend.js:45:16
    at node_modules/parcel-bundler/node_modules/posthtml/lib/index.js:188:14
    at tryCatch (node_modules/parcel-bundler/node_modules/posthtml/lib/index.js:271:12)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions