This seems odd, but I'll reserve judgement.  Why not just check the type of `html`, or use a two functions for the two cases?