I’m not sure how Discourse should handle this. I think that for posts that are created directly on Discourse it makes sense to say that only a limited subset of HTML is supported, but for posts that are created through the API, or by pulling in an RSS feed it’s not clear to me how far Discourse should go to support HTML.
I think it would make sense to add the code that I posted above directly to the WP Discourse plugin. The plugin is already using similar functionality to clean up comments that are pulled to WordPress from Discourse. That has been in use for some time now with no reports of problems. I’ll get back to you about this within the next couple of days.