[4.0] Graceful `@parent` directive handling [#4942]

[4.0] Simplifies `Factory::extendSection` method
[4.0] Removes `@parent` from content before returning from `Factory::yieldContent`