Problem
@parent in a layout that extends another layout renders as text, and the outer layout's section is lost. With
<nav>@section('nav')BASE@show</nav><main>@yield('content')</main>
@extends('base')
@section('nav')MID @parent@endsectiona page that extends mid renders <nav>MID @parent</nav>, and with its own @section('nav')PAGE @parent@endsection it renders <nav>PAGE MID @parent</nav>. Expected: MID BASE and PAGE MID BASE. A page's own sections have @parent replaced with the parent-content placeholder when they are extracted, and the final layout fills it; the sections of an intermediate layout were stored with .trim() only, so their @parent never became that placeholder.
Fix
The intermediate-layout branch marks the @parent in each of its sections the same way. Layout source arrives without the masking the page gets first, so @@parent, a longer word such as a@parents.com, and a @parent inside an HTML or comment are left as they render today.
Tests
Six cases in test/directives/nested-layout-parent.test.ts. On main four fail, for example:
Expected: "PAGE MID BASE"
Received: "PAGE MID @parent"The other two (text that stays text, and a page that replaces the section without @parent) pass on main and with the change. bun run build, bun run smoke:install, bun run typecheck, bun run lint and bun run format:check pass, and bun test packages examples --max-concurrency=1 has no new failures compared with main (the tests failing on both need a browser or other parts of the environment I don't have).