Remove `@parent` directive from extended section if section has not yet been extendedRemove `@parent` directive from extended section if section has not yet been extended #4942

implements proposal in issue #4942 for v4.1