Detect the parent for correct indent