Said code would transform a banana into a lead surrogate inside a span tag, followed by a trail surrogate inside another span tag. For example purposes I wanted to paste the bad result in a comment. It looks like this in my browser:
That was when I discovered that using lone surrogates in comments doesn't work. That's fine-ish. Lone surrogates are invalid after all. But I lost my comment text without an opportunity to fix it!
I tried it again, and again, until I realised it was failing because of the surrogates. And then I realised that posting such comments would send me to the same page with the comment text in a URL query parameter, like
This is rather minor, but it would have been nicer if I had a popup saying "your comment is bad and you should feel bad" or something, instead of nuking my comment into the URL.
And I discovered that posting questions with lone surrogates doesn't quite work either :)