Properly close html tag in string