HTML is valid in markdown files. Just don’t add empty lines and you’ll be fine.

---
---

## My heading

<img src="{{ page.image }} />

## Another heading

<div align="center">
    <img src="{{ page.image }} />
</div>

Bad - using empty lines will cause indented lines to become code block.

<div align="center">

    <img src="{{ page.image }}" />

</div>

You can even wrap markdown in HTML, if you do not indent.

## Heading

<div align="center">

### Heading

- Markdown bullet
- Another bullet <button>Text</button>

</div>