bugid: 52072 -- refactor solution to handle multiple identical tags where at least one is not closed