# Markdown rendering issue with image surrounded with HTML

**URL:** <https://meta.discourse.org/t/markdown-rendering-issue-with-image-surrounded-with-html/152801>\
**Category:** Bug\
**Created:** [26 במאי,‏ 2020,‏ 5:21pm UTC](https://meta.discourse.org/t/markdown-rendering-issue-with-image-surrounded-with-html/152801 "2020-05-26T17:21:21Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)\
**Post date:** [20 באוגוסט,‏ 2021,‏ 9:06pm UTC](https://meta.discourse.org/t/markdown-rendering-issue-with-image-surrounded-with-html/152801/29 "2021-08-20T21:06:55Z")

</div>

I’m really not understanding the complication here. Clearly, the HTML image tag is being replaced with markdown – e.g. `![](upload://6zqK52dO23i1JsYH2oyMU12U2ro.jpeg)`. Why not just make that include two carriage returns before the `!` ? That’ll make it render right, and allow the image upload feature to work to prevent broken images and cross-site issues.

Is there a real-world non-theoretical situation where that whitespace might cause a problem? Is that problem _worse_ than the “images are just broken all of the time” state of the current plugin?

@david, you note that “the newline solution will probably not happen” because the “key thing for us is to maintain the integrity of the content”. But the content is already changed by inserting the tags in the first place. I… really don’t get how this is possibly better.

Right now _every time_ someone includes an image in their wordpress post, the images come back broken, and I am frequently having to deal with “images are broken” comments, now often followed by “yes, it’s bceause discourse sucks” replies. I would like to avoid both of these things.

I understand that the “don’t download images” setting may be a workaround, but actually I _do_ want images to be downloaded, so hopefully that can just be a temporary fix.

---

_[View the full topic](https://meta.discourse.org/t/markdown-rendering-issue-with-image-surrounded-with-html/152801)._
