Auto inserted markup

Hello Team Discourse

I am seeing an issue where it looks like Discourse is auto inserting some markup after I create a message through the api. In one instance I was reviewing the post manually in the web ui, and I saw it change, which was really surprising.

Is there a setting that will turn off this behavior? The markup being inserted is empty and incorrect. Here are some examples:

To be clear, these tags are not in the original content posted through the api.

Does the original content that you are publishing contain img tags? If so, you may be running into an issue that is caused when Discourse downloads the remote image. When remote images from a post are downloaded by Discourse, an upload tag is created for the image. If that upload tag is wrapped in HTML tags, the image will not be displayed.

That issue is described in more detail here: Fix broken images for posts created by the WP Discourse and RSS plugins.