parser: Rework entity boundary check for element content Only use depth of input stack. This makes the input ID unused internally.