Put the ticks and the spoiler tag on different lines
If you use one backtick only for online code formatting you can do that, but with the three backticks for block code formatting you need to put spoiler tags on a different line than the backticks
<img id= "image" src="https://cdn.pixabay.com/photo/2018/02/08/22/27/flower-3140492_960_720.jpg" alt=" a flower">
<div id="img-caption">
stuff and more stuff?</div>
</div>```
Thank you now I see.
did not realize they had to be on separate lines