depending on file extension of the image path
The same text is already in the <figcaption> and screen-readers would read it twice, see #4737
We use HTML for a figure in markdown dialects that can't represent it natively. Closes #5121.